getParameterValues() not formatting correctly
Hi Magoo,
When you put the values in the hidden field in the Jsp as one string, only put the values don'r put selected in the string.
In the your servlet user getParameter for the hidden field and take it into a temporary string.
After that usibf the String Tokenizer on "&" create a array of string or you can directly loop through StringTokenizer to generate the Query.
Something like this
Assumming you have the hidden field contains the results of a listbox ( multiple values) into one long string as "Test1&Test2&Test3".
Now in you servlet use the following code
String language = request.getParameter("hidden1");
StringTokenizer strToken = null;
statement.executeUpdate("Delete * from partdb.profile_lang where partid = \"" + PartID + "\" ");
strToken = new StringTokenizer (language,"&");
while( strToken.hasMoreElements())
{
statement.executeUpdate("Insert into partdb.profile_lang (language, partid) "
+ " values(\"" + (String)strToken.nextToken() + "\", \"" + PartID + "\") ");
}
-Zeon
Be a Creator .... not a creature of your circumstances !!!
Bookmarks