i would like to do the following but i cannot access the ArrayList via
the JSP. could anyone help?
1. use the doView()- method to store an ArrayList in the session
================================================== ===============
doView(){
....
MySimpleBean my1 = new MySimpleBean();
my1.setMessage("test1");
MySimpleBean my2 = new MySimpleBean();
my2.setMessage("test2");
ArrayList mySimpleBeans = new ArrayList();
mySimpleBeans.add(my1);
mySimpleBeans.add(my2);
request.getPortletSession().setAttribute("jens", mySimpleBeans,
PortletSession.PORTLET_SCOPE);
....
}
2. access this bean from the JSP (this does not work)
================================================== ===============
<%@ page session="true" contentType="text/html"
import="<%} %>
=============
|
Posts: n/a
|
i looked at it once more and noticed the following which seems to be
related to the problem. i can access the attribute "jens2" in the jsp but i cannot access the attribute "jens3". there will be an empty string cerated for "jens3". can you explain me why? thanks! Portlet ================================================== =============== doView(){... request.setAttribute("jens2", "REQUEST hello world"); request.getPortletSession().setAttribute("jens3", "SESSION hello world"); ....} JSP ================================================== =============== <jsp:useBean ></jsp:useBean> .... |