Monday, September 17, 2012

[JAVA/JSP] How to get the variables as an Array, request.getParameter, request.getParameterValues












1. For array - request.getParameterValues([VALUENAMEASARRAY]);
You can get variables as an Array by follow codes
String[] arrayParam1=request.getParameterValues("param1");
for(int i=0;i<arrayParam1.length;i++){
 System.out.println("arrayParam1["+i+"] : "+arrayParam1[i]);
}


2. For single - request.getParameter ([VALUENAME]);
Normally of how to get a variables
<%
String yourparams=request.getParameter("yourparams");
System.out.println("value : "+yourparams);
%>

No comments:

Post a Comment