HttpSession session=request.getSession();
session.setAttribute("sessions", session);
response.sendRedirect("***.jsp");
在****.jsp中通过sessions取到session对象;
<ahref="在web.xml中配置 sess?name=${一个对象 }">你好</a>
?模拟传值
web.xml配置
<servlet>
<servlet-name>sess</servlet-name> <servlet-class>****.sess</servlet-class> </servlet> <servlet-mapping> <servlet-name>sess</servlet-name> <url-pattern>/sess</url-pattern> </servlet-mapping>
对象属性若是字符串
String name=requst.getParameter("name");