A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Frameworks
»
Struts
Author
setting scope of variable in Struts2
gobburi saikrishna
Ranch Hand
Joined: Jan 21, 2008
Posts: 52
posted
May 08, 2010 05:10:12
0
Hello All
can i set scope=session in struts.xml in Struts2....
i have a variable which is set to session in action class
and i want to refer that variable in my jsp as session scope in my
struts
tag
example
i have a variable say parties in my action class which is list and it is set as session scope
session.setAttribute("parties", parties);
in my Jsp
iam using struts tag, get this in session scope.
like : <td >
*
<s:label for="partyField" id="partyLabel" value="%{getText('party')}" /></td>
<td > <s:select name="party" id="party" list="parties" listKey="id" listValue="name"></s:select> </td>
</tr>
iam getting error:
org.apache.jasper.JasperException: tag 'select', field 'list', name 'party': The requested list key 'parties' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location]
please anyone try to reslove this
Thanks
Saikrishna
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12617
I like...
posted
May 08, 2010 09:08:37
0
http://struts.apache.org/2.1.8/docs/ognl.html
But if you're always setting the same list in session I'm not sure what you're accomplishing over making it an action property.
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: setting scope of variable in Struts2
Similar Threads
Struts2: Retern all the values inside the list in my Action
Struts2 nested iterators with listboxes
Data mismatch between two separate lists in a single iterator in struts2
In struts2 delete is not Working
Struts2 valuestack error
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter