Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get all parameters from JSP page

Tags:

parameters

jsp

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?

like image 577
Gnaniyar Zubair Avatar asked Mar 30 '10 21:03

Gnaniyar Zubair


People also ask

How parameters can be accessed from HTML using JSP?

getParameter() – Passing data from client to JSP The familiarity of the getParameter() method in getting data, especially form data, from a client HTML page to a JSP page is dealt with here. The request. getParameter() is being used here to retrieve form data from client side.

Which of the following is used to read parameters from a JSP page?

For displaying the parameters on the file. jsp page, we have used the expression language (${}). However you can also use the following code which is using the JSP expression tag and request implicit object.

What is getParameter () method explain with example?

getParameter is a function name in JSP which is used to retrieve data from an HTML/JSP page and passed into the JSP page. The function is designated as getParameter() function. This is a client-side data retrieval process. The full function can be written as request. getParameter().


1 Answers

<%@ page import = "java.util.Map" %> Map<String, String[]> parameters = request.getParameterMap(); for(String parameter : parameters.keySet()) {     if(parameter.toLowerCase().startsWith("question")) {         String[] values = parameters.get(parameter);         //your code here     } } 
like image 110
Finbarr Avatar answered Sep 22 '22 23:09

Finbarr