aspose file tools*
The moose likes Struts and the fly likes how to get selected value from s:select tag in struts 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to get selected value from s:select tag in struts 2" Watch "how to get selected value from s:select tag in struts 2" New topic
Author

how to get selected value from s:select tag in struts 2

sunil gupta
Greenhorn

Joined: May 07, 2008
Posts: 21
hi,

i m new to struts to and got stuch at this.

how to get selected value from <s:select> tag in struts 2.

regards
Sunil
sunil gupta
Greenhorn

Joined: May 07, 2008
Posts: 21
This post has been solved.

just create get and set method witht he same name as the name of select tag.

then set the getlist() and setlist().

in the jsp page use function getlist and it will give back whateve is selected in the select list.

thanks
Sunil
prabhu pandurangan
Ranch Hand

Joined: May 23, 2008
Posts: 132
Hi Sunil,
Im new to struts 2, how to get the selected <s:select> value on onchange event using javascript.

Also sunil, if you have done any sample application using struts 2, Please send me those. Im in need of it.



Regards,
Prabhu.
thedancingllama
Greenhorn

Joined: Jul 29, 2008
Posts: 1
Just an FYI, this was plaguing me for a little while,
but in order for the select list to set the selected value, you need the params interceptor (or default interceptor stack) defined in your struts.xml in order for the setter(s) to work in your action.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61662
    
  67

"thedancingllama", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
Don't get me started about those stupid light bulbs.
 
subject: how to get selected value from s:select tag in struts 2