How to retrieve input parameter values in the servlet?

How to retrieve input parameter values in the servlet?

Postby Kishan » Fri Feb 08, 2013 3:47 pm

How to retrieve input parameter values in the servlet? Can I pass more than one parameter with same name?
Kishan
 
Posts: 191
Joined: Tue Jan 29, 2013 4:21 am

Re: How to retrieve input parameter values in the servlet?

Postby Kishan » Mon Feb 18, 2013 5:12 am

You can retrieve input parameters from HttpServletRequest as below:

String value = request.getParameter("paramname");

if request contains same parameter more than once or mult select input parameter gives more one selected values using this method.
String values[] = request.getParameterValues("paramname");
Kishan
 
Posts: 191
Joined: Tue Jan 29, 2013 4:21 am


Return to Servlets

Who is online

Users browsing this forum: No registered users and 2 guests