在收到从ajax到控制器的请求后,我无法通过ModelAndView(“/authenticationError.jsp”)移动到下一个页面;控制器代码
@RequestMapping(value = "/ProcessReject,method = RequestMethod.POST“)
public ModelAndView Reject(@RequestParam(value = "StatusComments") String StatusComments,
@RequestParam(value = "ruleIndex") String ruleIndex,
@RequestParam(value = "country") String country,
HttpSession session) throws Exception {
ModelAndView mav ;
System.out.println("StatusComments "+ StatusComments);
System.out.println("ruleIndex "+ ruleIndex);
System.out.println("country "+ country);
String quicklookid = (String) session.getAttribute("quicklookid");
//rejectRuleBusinessLogic.reject(ruleIndex, country, quicklookid, StatusComments);
mav = new ModelAndView("/authenticationError.jsp");
return mav;Ajax代码
function showRejectStatusMsg(value1, value2)
{
$.ajax({
type: "POST",
cache: false,
url: "ProcessViewRule.ncr",
data:"ruleIndex=" +value1 +"&country="+value2,
success: function(response) {
},
error : function(e) {
alert('Error in response...' + e);
}
}); jsp代码-
<a href="javascript:showRejectStatusMsg(<c:out value='${List.ruleindex}'/>, '<c:out value="${List.country}"/>')" id="rejectLink" class="navlink" >Reject</a>))发布于 2015-10-10 21:27:15
您正在这样做,wrong..You需要编写.jsp,可以将视图设置为
mav.setViewName("list"); 基本上
new ModelAndView("welcomePage", "WelcomeMessage", message);是简写
ModelAndView mav = new ModelAndView();
mav.setViewName("welcomePage");
mav.addObject("WelcomeMessage", message);https://stackoverflow.com/questions/33058960
复制相似问题