*
The moose likes Struts and the fly likes i have to print( view jsp ) variable which is created in action class in (struts 2 ) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "i have to print( view jsp ) variable which is created in action class in (struts 2 )" Watch "i have to print( view jsp ) variable which is created in action class in (struts 2 )" New topic
Author

i have to print( view jsp ) variable which is created in action class in (struts 2 )

vineet walia
Ranch Hand

Joined: Feb 16, 2008
Posts: 138
my action class is



my jsp is



i am using session.put("tokenid",tokenid); to set tokenid variable in session
but its showing null point exception error while executing



Anirban Chowdhury
Ranch Hand

Joined: Aug 05, 2008
Posts: 36
Hi.
I am not sure about SessionAware ,but if you just have to put a token in the session and test it out, then I use the below code :


In the jsp , I use the below line.
<s:property value="#session.sessionTempRegistrationKey"/>

Do let me know in case you find any better alternatives.
Oh, and I am using struts 2.2.1.1

Thanks & Warm Regards,
Anirban


To living life on the edge! I blog my experiences @ http://anirbanchowdhury.wordpress.com.
vineet walia
Ranch Hand

Joined: Feb 16, 2008
Posts: 138
from which interface you are implementing action class ..
i am new to struts so dont know that much
Anirban Chowdhury
Ranch Hand

Joined: Aug 05, 2008
Posts: 36
extends ActionSupport implements StrutsStatics
vineet walia
Ranch Hand

Joined: Feb 16, 2008
Posts: 138
thanks a lot man..
its working
vineet walia
Ranch Hand

Joined: Feb 16, 2008
Posts: 138
one more stupid question..




is this is correct way to get that variable inside jsp
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: i have to print( view jsp ) variable which is created in action class in (struts 2 )
 
Similar Threads
Translating JAVA code to VBA (excel)
JSP and ValueBean..Tight Coupling..
struts 2 validator problem
how to get value in jsp from ONGL (Struts 2)
Handling multiple form data in struts2