| Author |
JSP's Java retrieve variable from Action class
|
wai chun chor
Greenhorn
Joined: Sep 28, 2011
Posts: 2
|
|
Action Class:
say I have an action class with variable integer "totalUsers" set to 40.
JSP:
I have no problem retrieving this value via Struts tag such as:
The code above works fine.
But how do I get this value via Java code inside my JSP file?
|
 |
Joe Ess
Bartender
Joined: Oct 29, 2001
Posts: 8264
|
|
Welcome to the JavaRanch.
First, you should reconsider. Using Java in a JSP a sign that you are putting logic in the display tier.
That said, you can get to the Action via the ValueStack, which you can obtain from the static method in ServletActionContext
|
"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
|
 |
 |
|
|
subject: JSP's Java retrieve variable from Action class
|
|
|