jsp页面
elem : '#usermanange',
height : 'full-120',
url : '${path}/usma/getpage.do',
cellMinWidth :100,
cols : [ [ //标题栏
{}......
action层
@RequestMapping(value = "/usma")
public class UserAction extends BaseAction {
@Autowired
private UserService UserService;
private Logger logger = LoggerFactory.getLogger(getClass());
@GetMapping("/getpage")
public JSONObject getuserListByPageBean(@RequestParam Integer page, @RequestParam Integer limit,
@RequestParam(required = false, defaultValue = "") String username,
@RequestParam(required = false, defaultValue = "") String duty
) {
PageBean pageBean = new PageBean();
pageBean.setCurrentPageNumber(page);
pageBean.setLimit(limit);
Map<String, Object> param = new HashMap<String, Object>();
param.put("username", username);
param.put("duty", duty);
pageBean.setMap(param);
UserService.getuserResult(pageBean);
JsonConfig jsonConfig = new JsonConfig();
jsonConfig.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT);
JSONObject returnObject = JSONObject.fromObject(pageBean, jsonConfig);
returnObject = JsonCovert.filterNull(returnObject);
return returnObject;
你在浏览器上运行时,请求的全路径是什么?对比一下debug的路径,看下有什么区别。
当然会404,首先你debug如果进入了方法的话说明路由地址是没问题的。但是记住,Spring mvc 中你如果不加@respondBody的话,默认访问的是页面,他会给你返回的信息去找页面。你返回个jsonObject,他当然找不到。方法定义也出了问题。
public String xxxxx(){
xxxxxx;
return "xxxx.jsp";
}
这样他才能找到。
有没有错误信息,贴出来看看,方便查找原因。
404那一定是路径写错了,你看看是不是相对路径的问题,项目名称有没有加上
浏览器报错
Failed to load resource: the server responded with a status of 404 (Not Found)
usma/getpage.do?page=1&limit=10:1 Failed to load resource: the server responded with a status of 404 (Not Found)
您好,我是有问必答小助手,你的问题已经有小伙伴为您解答了问题,您看下是否解决了您的问题,可以追评进行沟通哦~
如果有您比较满意的答案 / 帮您提供解决思路的答案,可以点击【采纳】按钮,给回答的小伙伴一些鼓励哦~~
ps:问答VIP仅需29元,即可享受5次/月 有问必答服务,了解详情>>>https://vip.csdn.net/askvip?utm_source=1146287632
非常感谢您使用有问必答服务,为了后续更快速的帮您解决问题,现诚邀您参与有问必答体验反馈。您的建议将会运用到我们的产品优化中,希望能得到您的支持与协助!
速戳参与调研>>>https://t.csdnimg.cn/Kf0y