passing array of data from jsp to servlet -
i have form has input field car model , car color following
<form> <input id="car1" name="car1" value="audi"/> <input id="color1" name="color1" value="red"/> <input id="car2" name="car2" value="honda"/> <input id="color2" name="color2" value="black"/> <input id="car3" name="car3" value="toyota"/> <input id="color3" name="color3" value="silver"/> </form> i need send input value servlet , maintain relationship between car , color. in order maintain relationship between car , color, in servlet thinking of creating map object car key , color value. best way send input value , create map in servlet. other problem number of car , color dynamic. in other words, may have car1,color1,car2,color2 or car1,color1,car2,color2,car3,color3.
thanks in advance
the best way call request.getparametervalues();
this returns map of key-values iterate on them , have corresponding values.
Comments
Post a Comment