the server responded with a status of 404 (Not Found)

前端之家收集整理的这篇文章主要介绍了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

这次的错误后台打印出了错误的原因:

@H_502_12@Error querying database.  Cause: com.MysqL.jdbc.exceptions.jdbc4.MysqLSyntaxErrorException: You have an @H_502_12@error @H_502_12@in your sql Syntax; check the manual that corresponds @H_502_12@to your MysqL server version @H_502_12@for the right Syntax @H_502_12@to use near '*)
        @H_502_12@FROM  web114_keyword_rele r
        @H_502_12@where r.del_flag ='0'

 ' at line 1

出错的xml语句为:

<@H_502_12@select id="countReleSet" parameterType="java.util.HashMap" resultType="java.lang.Integer">
        @H_502_12@SELECT COUNT (*)
        @H_502_12@FROM  web114_keyword_rele r
        @H_502_12@where r.del_flag ='0'
        <@H_502_12@if test="keyId != null">
            @H_502_12@and r.key_id = #{keyId,jdbcType=VARCHAR},
        </@H_502_12@if>
        <@H_502_12@if test="storeId != null">
            @H_502_12@and r.store_id = #{storeId,jdbcType=VARCHAR}
        </@H_502_12@if>
    </@H_502_12@select>

一开始没反应过来错在哪里,就把语句扔到MysqL里面跑了一遍,其实是count和(*)之间不应该有间隔,把语句改成

<@H_502_12@select id="countReleSet" parameterType="java.util.HashMap" resultType="java.lang.Integer">
        @H_502_12@SELECT COUNT(*)
        @H_502_12@FROM  web114_keyword_rele r
        @H_502_12@where r.del_flag ='0'
        <@H_502_12@if test="keyId != null">
            @H_502_12@and r.key_id = #{keyId,jdbcType=VARCHAR}
        </@H_502_12@if>
    </@H_502_12@select>

即可。简直是一个愚蠢的错误。。。。。。 写xml语句的时候,还是放到MysqL里面跑一跑,确定没有语法问题再放进来。要不然后面报错了再调试还是挺讨厌的

猜你在找的Ajax相关文章