I am new to struts2 and I am trying to get a session object using a dynamic session key.
My application stream looks like this: user will hit an action from their browser
http://localhost:8080/prjcr/pad.action?userid=p02585@test.org
In the action class, I get a list of values from the web service using the request parameter p02585@test.org and save them in the session as follows:
//get the request parameter
userid=ServletActionContext.getRequest().getParameter("userid);
QDefn[] qDefn = proxy.getQDefns(userid); //webservice call
List<QDefn> qdList = new ArrayList<QDefn>();
qdList.add(Arrays.asList(qDefn));
Retrieve a portion of a user from a query parameter that will be used as a session key
userid = userid.substring("UserId", userid.substring(0, userid.indexof('@'));
ActionContext.getContext().getSession().put("UserId", userid);
and then move the linked list of values to the session
ActionContext.getContext().getSession().put(userid, qdList);
and navigate to the JSP that displays this list in the drop-down list as follows:
<s:select name="qdefn"
id="qdefn"
list="#session.%{#session.UserId}" ---What is the notation here??
listKey="defnName"
listValue="defnName"
headerKey="ALLQD"
headerValue="All" > </s:select>
qdList jsp, , .
java session.get(userid). OGNL. , , Struts2/OGNL.