Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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
 
 
subject: how to pass parameter from struts action class to jsp page