I have n number of text fields named in the form \"Question.....\". How can I get all the parameters which starts with \"question\" from the JSP page to the Action?
The fastest way should be:
<%@ page import="java.util.Map" %>
Map parameters = request.getParameterMap();
for (Map.Entry entry : parameters.entrySet()) {
if (entry.getKey().startsWith("question")) {
String[] values = entry.getValue();
// etc.
Note that you can't do:
for (Map.Entry entry :
request.getParameterMap().entrySet()) { // WRONG!
for reasons explained here.