File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts 2 s:select query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 s:select query" Watch "Struts 2 s:select query" New topic

Struts 2 s:select query

Luke Gee

Joined: Apr 11, 2012
Posts: 5
Hi all,

Im having a little trouble working out something and was wondering if anyone knows if this can be done and if so how.

So I have a dropdown which will be selection of actions that can be done on each user.

here is the code i have:

the listKey="action" will populate the value of the select with something along the lines of "ceaseAccount.action" etc. These will cause the page to redirect to another where the chosen options can be checked, processed and such. What i need though is to include variables on the action: something like listKey="action" + "?key=<s:text name="userKey"/>&userName=<s:text name="userName"/> giving "ceaseAccount.action?userKey=E9F81F9C-163E-42BB-9F64-20DA646D1679&userName=thisUserName" , so the output would be different for each row in the table. I know my example wont work but i hope it shows what im looking for.

Thanks in advance,

Yogesh Lonkar
Ranch Hand

Joined: Jul 17, 2012
Posts: 94

what you can do is use onselect="doAction" attribute of <s:select/> tag which will call and java script method such has

Learning some thing New Every Day
I agree. Here's the link:
subject: Struts 2 s:select query
It's not a secret anymore!