This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Servlets and the fly likes passing many values from jsp and getting only one value in servlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "passing many values from jsp and getting only one value in servlet?" Watch "passing many values from jsp and getting only one value in servlet?" New topic
Author

passing many values from jsp and getting only one value in servlet?

maggie karve
Ranch Hand

Joined: Dec 29, 2009
Posts: 186
i am creating a dropdown box in jsp and sending it to servlet...

i am getting the particular value in servlet....
but when i am using it to update the database i dont know what to write??
my servlet is as follows

Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

You may be interested in ServletRequest#getParameterValues.


[My Blog]
All roads lead to JavaRanch
maggie karve
Ranch Hand

Joined: Dec 29, 2009
Posts: 186
thanks i made changes in code..i used selectedColumn.equals("Principal") instead of ==operator and the code is updating the database values......
Fidel Edwards
Ranch Hand

Joined: Mar 19, 2008
Posts: 231
Hi Maggie,

Since you are using two <select > with the same name. Here you can do 2 things.

i) Either rename the first object name from "parameter" to some other.OR
ii) Use Enumeration request.getParameterNames("parameter") . In this you can iterate all the objects having name as 'parameter'.




God Gave Me Nothing I Wanted, He Gave Me Everything I Needed.
OCPJP6
maggie karve
Ranch Hand

Joined: Dec 29, 2009
Posts: 186
ok..i will do that ..thanks....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: passing many values from jsp and getting only one value in servlet?