after response.sendRedirect? how to receive the back msg from server?
I m on Spring MVC, after i use response.sendRedirect, how do i receive response from the server. Actually i am working on a sms sending project. so once i response.sendRedirect(string), it gives a status of sent msgs. how do i receiv开发者_JS百科e it? since its in the new page...?
i am totally blank on this..
I usually add message parameter in Post Redirect Get Pattern. While data submitted, I set my redirect URL become:
String url = "sms?message=1"
return ModelAndView("redirect:" + url);
In the view template (jsp or velocity) I add script to check message parameter, and print message while message is exists
<c:if test="${param.message == 1}">
<h3><spring:message code="message.sms.sent" ></spring:message></h3>
</c:if>
精彩评论