• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to pass parameter from struts action class to jsp page  RSS feed

 
dhaval tamboli
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Have you tried by setting the parameter in the request object in the action page.
 
Renz Alexander
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try to use the the if tag and place the button inside that tag and add your coditions
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!