下面的代碼是項目中的 action 的代碼, 其中返回了 "complete_user_info" 這個字符串, 在 strut 中, xml 文件中會有對應的配置, 用來指明跳轉到哪個 jsp 頁面. 可是這個項目中, 我搜遍了整個項目, 就是找不到這樣的配置文件, 全盤搜索"complete_user_info"這個字符串, 只有下面的代碼出現這個字符串, 那么, 我想請問下, 下面的代碼中, action 和 html 之間是如何關聯起來的, 這個配置在哪里? 我自己的分析如下: 這個action 類已經使用 @RequestMapping 注解來映射url地址了, 理所當然就不會像 strut 一樣使用 xml 文件來配置映射關系了, 那么 action 的返回值指明為'complete_user_info', 他跳轉到哪個html 頁面, 這個配置在哪里, 我如何找到?
附: 我看了下 web.xml , 項目中還用到了 freemaker。
@RequestMapping(value = "/completeUserInfo", method = RequestMethod.GET)
public String completeUserInfo( HttpServletRequest request, HttpServletResponse ponse,Model model) throws Exception {
String userid = (String) request.getSession().getAttribute("userid");
try {
JSONObject obj = pingTaiService.queryUserInfo(request.getSession(),userid);
String phone = (String) request.getSession().getAttribute("account");
model.addAttribute("phone", phone); //注冊手機號
if(!obj.isEmpty()){
model.addAttribute("tag", "false"); //編輯用戶資料
model.addAttribute("userInfo", obj.toString());
}else{
model.addAttribute("tag", "true"); //新增用戶資料
model.addAttribute("userInfo", obj.toString());
}
return "complete_user_info";
} catch (Exception e) {
logger.error(e.getMessage());
}
return null;
}
添加回答
舉報
0/150
提交
取消