wood burning stoves 2.0*
The moose likes Struts and the fly likes access session in <s:hidden> element struts2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "access session in <s:hidden> element struts2" Watch "access session in <s:hidden> element struts2" New topic
Author

access session in <s:hidden> element struts2

Deeps Mistry
Ranch Hand

Joined: Jan 31, 2009
Posts: 189
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

Joined: Jan 31, 2009
Posts: 189
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

Joined: Sep 29, 2008
Posts: 12617

Please don't post the same question multiple times--doing so wastes time and resources.
Craig Ricciuto
Greenhorn

Joined: Nov 05, 2009
Posts: 9
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

Joined: Nov 05, 2009
Posts: 9
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

Joined: Oct 08, 2009
Posts: 276
Craig Ricciuto wrote: So now, if someone wouldn't mind telling me, why does it work like this?


You'll find an explanation here!


OCJP 6 (93%)
Craig Ricciuto
Greenhorn

Joined: Nov 05, 2009
Posts: 9
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

Joined: Oct 08, 2009
Posts: 276
No problem!
Craig Ricciuto
Greenhorn

Joined: Nov 05, 2009
Posts: 9
whoops, my bad.
 
 
subject: access session in <s:hidden> element struts2
 
Similar Threads
Struts2 variable inside javascript
Struts2 valuestack error
struts2 modeldriven unable to transfer form data to model object
retrieve request parameters in action class Struts2 URGENT
Help needed with struts2