request:实现请求转发和mvc模式

 

-----------------------------------------------------------------------------------------------------------

String data="xxxxxx";
request.setAttribute("data", data);
//request也可实现转发
request.getRequestDispatcher("/message.jsp").forward(request, response);

----------------------------------------------------------------------------------------------

<body>
$(data )
<%
String message=(String)application.getAttribute("message");
out.write(message);
%>
</body>

-------------------------------------------------------

 

posted @ 2017-03-22 19:49  贱贱的小帅哥  阅读(129)  评论(0编辑  收藏  举报