java - Several forms in a JSP page: how to avoid duplicated ids and tedious parameter processing at the same time? -
I have a JSP page which displays a list of items, each one with a form that allows the user to The changes made by the user of the data of this item are processed by the servlet.
Right now, the JSP page generates invalid HTML, because every input of each form shares the same ID. I can add some suffix to each ID, but then on the servlet side that collects all the parameters The code calling is not as easy as the request.
I can use the request GetParameterNames () and think which input is the ID per its prefix, but I think it looks ugly and this is probably a bad code.
Am I missing a better solution?
Right now, JSP pages generate invalid HTML, because every input of each form is same ID is shared
IDs are not considered here because the request.getparameter ("name")
requires the attribute name. So make sure that you have unique name
for input in various forms.
Many forms in the JSP page: How to avoid duplicate ID and tedious parameters processing at the same time?
I believe that you have submitted the button for each form, it does not matter that you are not submitting to the servlet
Comments
Post a Comment