wood burning stoves 2.0*
The moose likes Struts and the fly likes Struts2 Query  using OGNL for displaying data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 Query  using OGNL for displaying data " Watch "Struts2 Query  using OGNL for displaying data " New topic
Author

Struts2 Query using OGNL for displaying data

PavanPL KalyanK
Ranch Hand

Joined: Feb 28, 2009
Posts: 212



(I have not included the full jsp page )

My query is why # is used in some cases and in some cases # is not used .Please explain .
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

The "#" character is used when an action context variable is created, for example by an <s:set>, <s:url>, or similar tag. No "#" character is needed when referencing objects on the stack itself. I think of the action context in two ways: the value stack, and another scope (like session or request scopes, but different).

When accessing the action context "scoped" variables we need to use "#", when accessing things on the stack, we don't.
PavanPL KalyanK
Ranch Hand

Joined: Feb 28, 2009
Posts: 212
Thanks for excellent answer.
 
jQuery in Action, 2nd edition
 
subject: Struts2 Query using OGNL for displaying data
 
Similar Threads
Need to create dynamic <s:property tag using <s:iterator
<s:property value="#request.firstName" escape=" " default=" "/> problen in Struts2
Struts2 OGNL Expression
Struts bug? <s:if> string comparison fail
struts 2 example to have a link in one of the Iterated value in the JSP and pass it to an action