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?
This should print out all Parameters that start with "Question".
<%@ page import = "java.util.*" %>
Parameters:
<%
Enumeration parameterList = request.getParameterNames();
while( parameterList.hasMoreElements() )
{
String sName = parameterList.nextElement().toString();
if(sName.toLowerCase.startsWith("question")){
String[] sMultiple = request.getParameterValues( sName );
if( 1 >= sMultiple.length )
// parameter has a single value. print it.
out.println( sName + " = " + request.getParameter( sName ) + "
" );
else
for( int i=0; i" );
}
}
%>