首页 新闻 赞助 找找看

struts2注解url路径,ajax调用路径404

0
悬赏园豆:40 [已关闭问题] 关闭于 2017-05-03 09:38

 公司用struts2注解,我写了一个方法,路径方法用struts2的action注解,运行一直报错404。

后面公司说要用

复制代码
复制代码
public String testk(){
        JSONObject result=new JSONObject();
        System.out.println(validcode);
        if (this.validcode(validcode,"moblieCode") == 0) {
            result.put("result", 1);
            this.json=result.toString();          
}
else{ result.put("result",2); this.json=result.toString(); } return this.JSON_MESSAGE;
//return result.toString(); }
复制代码
复制代码

注释的是我自己写的,后面用公司人说要这样写。结果却是不报404了。

 我有去看,这个JSON_MESSAGE是他继承的父类的(WWWA ),这个父类继承了 ActionSupport。可以我觉得很奇怪,你返回的值是 JSON_MESSAGE,为什么我可以再

ajax里获取的result.result这个数的值,同时为什么404错误。

 求大神指导!!!(需要补充提交什么留言通知我~~~~(>_<)~~~~)感谢!

CXL123的主页 CXL123 | 初学一级 | 园豆:90
提问于:2016-06-08 17:59
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册