@RequestMapping(value = "/guestbook.jspx", method = RequestMethod.POST)
public void submit(Integer siteId, Integer ctgId, String title, String content, String email, String phone,
String qq, String captcha, HttpServletRequest request, HttpServletResponse response, ModelMap model)
throws JSONException {
CmsSite site = CmsUtils.getSite(request);
CmsUser member = CmsUtils.getUser(request);
if (siteId == null) {
siteId = site.getId();
}
JSONObject json = new JSONObject();
try {
if (!imageCaptchaService.validateResponseForID(session.getSessionId(request, response), captcha)) {
json.put("success", false);
json.put("status", 1);
ResponseUtils.renderJson(response, json.toString());
return;
}
} catch (CaptchaServiceException e) {
json.put("success", false);
json.put("status", 1);
ResponseUtils.renderJson(response, json.toString());
log.warn("", e);
return;
}
String ip = RequestUtils.getIpAddr(request);
cmsGuestbookMng.save(member, siteId, ctgId, ip, title, content, email, phone, qq);
json.put("success", true);
json.put("status", 0);
ResponseUtils.renderJson(response, json.toString());
}
上面代码留言提交后执行的吧,guestbook.jspx文件找不到,实际上是guestbook_index.html文件,在哪定义程序下一步跳转到guestbook_index.html |
|