| | |
reading jsp array in to java(servlet) program
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Aug 2009
Posts: 26
Reputation:
Solved Threads: 1
hi helpers,
i'm trying to read an array from jsp in to java(servlet) page
the code is
JSP CODE (readingcheck box values):
its working ok!
JAVA CODE(reading array values):
the above java code didnt worked.
i also tried this
this didnt worked too
is there any other way to read array values from jsp page?
where am i wrong?
thanks,
BeanBoy !
i'm trying to read an array from jsp in to java(servlet) page
the code is
JSP CODE (readingcheck box values):
JSP Syntax (Toggle Plain Text)
String select[] = request.getParameterValues("sel"); if (select != null && select.length != 0) { for (int i = 0; i < select.length; i++) { out.println(select[i]);
JAVA CODE(reading array values):
JSP Syntax (Toggle Plain Text)
String select2[] = request.getParameterValues("select"); for (int i = 0; i < select2.length; i++) { System.out.println(select2[i]); }
i also tried this
JSP Syntax (Toggle Plain Text)
String[] select= new String[100]; for (int i = 0; i <10 ; i++) { select[i] = request.getParameter(select[i]); System.out.println(select[i]); }
is there any other way to read array values from jsp page?
where am i wrong?
thanks,
BeanBoy !
getParameter only works if the parameter you are accessing exists in the URL that was sent to the servlet.
Are you sure that the array is being sent to the servlet?
If the url is this : "/jspservlet?name=blah&myArray={1,2,3}" (the curly brackets would be replaced with the correct url encode for brackets which would be %something), then using request.getParameter("myArray") would return the array.
Are you sure that the array is being sent to the servlet?
If the url is this : "/jspservlet?name=blah&myArray={1,2,3}" (the curly brackets would be replaced with the correct url encode for brackets which would be %something), then using request.getParameter("myArray") would return the array.
Life... Is a Moment
![]() |
Similar Threads
- data file and servlet program (JSP)
- very basic java GUI Program... (Java)
- Need Help with java Inventory program Part3 (Java)
- Reading commands from an array (C++)
- Problem with <%jsp:include page> (JSP)
- Programming VBA: Reading excel into an Array (Visual Basic 4 / 5 / 6)
- knowing jsp which is calling pagevia this servlet (JSP)
- Need help with Array sorting using Java Servlet (Java)
- Java Servlet Problem :( (Java)
Other Threads in the JSP Forum
- Previous Thread: ssl implementation using tomcat 6
- Next Thread: JSP and MySql connectivity
Views: 759 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for JSP
apache array backbutton combobox comma connection csv database development directorystructure dropdownlist dynamicpagetitles eclipse frames glassfish ie8 imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 mysql netbeans network parameters passing ping printinserverinsteadofclient project read redirect request.getparameter response seperated servlet servletdopost()readxml sessions software sql ssl state_saving_method stocks sun tomcat tutorial update values video web write





