This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread 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 Android Security Essentials Live Lessons this week in the Android 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
 
jQuery in Action, 2nd edition
 
subject: how to pass parameter from struts action class to jsp page
 
Similar Threads
[URGENT]Problems with Struts and Tiles
How to store a value so that any JSP page can read it?
Query String Problem
invoke ActionServlet as welcome page
invoke ActionServlet as welcome page