954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

passing values of Select box from JSP to Action class thru form Bean

This is about jsp, beans with struts. The problem is, I am using one jsp which is containing some select boxes. I ll be populating the select boxes from DB thru beans and action class. It’s working properly. The problem is with the data insertion from JSP to DB. The case is, I have to add a new record (record is containing the select boxes data as fields). Now if I select any data from the ‘select’box, I have to capture that data thru ‘action class’ and then pass that to ‘form Bean’ so that I can update my DB with the new record. But what is happening is, I am unable to get the values of the ‘select box’ data from the JSP to action class thru form Bean. Can any one help me out with this? One more thing, I can’t use sessions in JSP. If any one can provide some examples in this regard, that will be of great use.

saivemuri
Newbie Poster
1 post since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

Whether u r able to get the select box value in the action class whn u select or deselect the select box??????

mukeshky
Newbie Poster
1 post since Aug 2006
Reputation Points: 10
Solved Threads: 1
 

hey i hav same problem.. i cant get select box values to action class,.... hw to map it.. i mean 1stly hw does the multiple select box value pass .. as an array.. as a string.. waa?

Labs
Newbie Poster
1 post since Jul 2009
Reputation Points: 10
Solved Threads: 1
 

For single parameter you will use getParameter(java.lang.String name). If you look just few lines below this method in ServletRequest API you will see getParameterValues(java.lang.String name) to get multiple selection

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You