wood burning stoves*
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 Android Security Essentials Live Lessons this week in the Android 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....
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: passing many values from jsp and getting only one value in servlet?
 
Similar Threads
accessing values from servlets to jsp
problem loading jsp from servlets
delete row from database
java.lang.IllegalStateException: Cannot forward after response has been committed
can anyone tell me how do we update the values in servlet?