(1)session传值
session.setAttribute("temp",tempObj); //跳转后的jsp中可以取到 String tempObj = (String)session.getAttribute(temp);
?(2)隐藏域页面传值
<form action="target.jsp"> <input type=hidden name="test" value="test"/> <input type=hidden name="tes2" value="test2"/> </form> //在另一个页面中,通过以下的方式获得这些数据 String test=request.getParameter("test"); String test2=request.getParameter("test2");
?
(3)getServletContext
String context=(String)getServletContext().getAttribute(new String("chatTopic_1"));
(4)application
String content=(String)application.getAttribute(new String("chatTopic_1"));?