Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

access session in <s:hidden> element struts2

 
Deeps Mistry
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
using Struts2
i have set an attribute in session in My dao class.
I want to use this session in jsp.
session.setAttribute("EID",value);
JSP:

What am i doing wrong?

Please help me out.

thanks
 
Deeps Mistry
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
using Struts2
i have set an attribute in session in My dao class.
I want to use this session in jsp.
session.setAttribute("EID",value);
JSP:

What am i doing wrong?

Please help me out.
Its urgent!!!

thanks
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please don't post the same question multiple times--doing so wastes time and resources.
 
Craig Ricciuto
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what is the problem here? I'm having the same issue and have been searching for about an hour now...woulda been nice if the answer were on this page. =(
 
Craig Ricciuto
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So 5 minutes later I stumble upload a website that just had sample code:

I tried using the %{...} in my code and it worked. So now, if someone wouldn't mind telling me, why does it work like this?
 
Lorand Komaromi
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Craig Ricciuto wrote: So now, if someone wouldn't mind telling me, why does it work like this?


You'll find an explanation here!
 
Craig Ricciuto
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Lorand. Thanks for the link. I have since learned from reading the section "value is an Object!" and that "the value attribute is set automatically, since name attribute usually tells the framework which property to call to set the value."

So all I really needed to do was set the name attribute to the name of my property in the corresponding java file and the value would be set automagically. Bah! Took long to figure out something soooo simple and I barely needed to do anything. *sigh* =)

Thanks again.
 
Lorand Komaromi
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No problem!
 
Craig Ricciuto
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
whoops, my bad.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic