• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
vineet walia
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
vineet walia
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
from which interface you are implementing action class ..
i am new to struts so dont know that much
 
Anirban Chowdhury
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
extends ActionSupport implements StrutsStatics
 
vineet walia
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot man..
its working
 
vineet walia
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
one more stupid question..




is this is correct way to get that variable inside jsp
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic