本文主要是介绍the server responded with a status of 404 (Not Found),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
使用ajax跳转方法时,页面ctrl+shift+i调试报告了一个404错误,说找不到方法。页面地址栏直接指向方法的地址跳转也是404。目标方法是新增的,于是使用复制黏贴,确定各处方法名称一致之后,重启server。
调试时再次报错:
jquery.min.js Failed to load resource: the server responded with a status of 404 (Not Found) send @ jquery.min.js:4
这次的错误 在后台打印出了错误的原因:
Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*)FROM t__rele rwhere r.del_flag ='0'' at line 1
出错的xml语句为:
<select id="countRele" parameterType="java.util.HashMap" resultType="java.lang.Integer">SELECT COUNT (*)FROM t_rele rwhere r.del_flag ='0'<if test="Id != null">and r.id = #{Id,jdbcType=VARCHAR},</if><if test="storeId != null">and r.store_id = #{storeId,jdbcType=VARCHAR}</if></select>
一开始没反应过来错在哪里,就把语句扔到mysql里面跑了一遍,其实是count和(*)之间不应该有间隔,把语句改成
<select id="countRele" parameterType="java.util.HashMap" resultType="java.lang.Integer">SELECT COUNT(*)FROM t_rele rwhere r.del_flag ='0'<if test="Id != null">and r.id = #{Id,jdbcType=VARCHAR},</if><if test="storeId != null">and r.store_id = #{storeId,jdbcType=VARCHAR}</if></select>
即可。简直是一个愚蠢的错误。。。。。。
写xml语句的时候,还是放到mysql里面跑一跑,确定没有语法问题再放进来。要不然后面报错了再调试还是挺讨厌的
这篇关于the server responded with a status of 404 (Not Found)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!