Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

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

 
Ranch Hand
Posts: 140
  • 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



 
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: 140
  • 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: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot man..
its working
 
vineet walia
Ranch Hand
Posts: 140
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic