This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes how to pass parameter from struts action class to jsp page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to pass parameter from struts action class to jsp page" Watch "how to pass parameter from struts action class to jsp page" New topic
Author

how to pass parameter from struts action class to jsp page

dhaval tamboli
Greenhorn

Joined: Aug 02, 2010
Posts: 25
Hi,

I am using struts2.
I have one button in my jsp page. now I want like if variables value is X then that button should be visible else not. and that variable comes from struts action class.

I can pass that variable to jsp page as property values mean get and set methods in action class but I tried using

so that I can use
but I think above is not valid code.

Now I tried to pass parameter through struts.xml but problem is my result type also should be tiles as I am using tiles.

I am now totally clue less what to do

Please suggest me

Thanks
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You shouldn't be using scriptlets to control presentation; use either JSTL or the S2 tags. Just expose the action property and use the tags.
Prakash Mani - Attur
Ranch Hand

Joined: Oct 08, 2009
Posts: 100
Hi
Have you tried by setting the parameter in the request object in the action page.
Renz Alexander
Greenhorn

Joined: Jun 11, 2010
Posts: 28
try to use the the if tag and place the button inside that tag and add your coditions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to pass parameter from struts action class to jsp page