Forums Register Login

getParameterValues() in Servlet

+Pie Number of slices to send: Send
Hi,
I have a servlet that is getting some multiple values from a hidden field on a jsp form BUT it is is stringing those multiple values in the sql query. For example the user selects test1 and test2 the servlet picks up the parameter and passes it to the sql query as "selected=test1&selected=test2&" I thought I had the parameter broken up correctly but I must be missing something. Can someone take a look and see where I am going wrong? Thanks!
+Pie Number of slices to send: Send
Hi All,
Well, I can get the values but they don't seem to be formatting correctly. they come in from the hidden field as test1,test2,test3 and insert into one record in my database exactly the same way. Can anyone tell me what I am missing? Thanks!
+Pie Number of slices to send: Send
 

from a hidden field


If there is only one hidden field, then what did you expect?
getParameterValue is used when multiple fields have the same name, as in SELECT options that allow MULTIPLE.
If there is only one field, you will have to parse out the values.
Bill
He loves you so much! And I'm baking the cake! I'm going to put this tiny ad in the cake:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1239 times.
Similar Threads
Remove one parameter from the query string
SQL Error
Multiple Values in single parameter marker
join and in
Passing parameters from jsp to servlet
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 02:07:44.