wood burning stoves 2.0*
The moose likes Servlets and the fly likes Pass a String array from a jsp to a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Pass a String array from a jsp to a servlet" Watch "Pass a String array from a jsp to a servlet" New topic
Author

Pass a String array from a jsp to a servlet

JayaSiji Gopal
Ranch Hand

Joined: Sep 27, 2004
Posts: 303
Hi,

I need to pass a String[] from a jsp to a servlet. How do i do this?

I tried to set it as attributes of request, session etc, everytime i get a null pointer exception.

I tried to set it as a comma separated string. send this string as a query parameter and retrieve it using request.getParameter("name") -> this also returns a Null Pointer Exception.



Wht is wrong? I get the comma separated values in printCategories in the jsp properly.


SCJP 1.4, SCWCD 1.4<br /> <br />Thanks in advance!<br />Jayashree.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

JayaSiji,
You've already asked this question here:
http://www.coderanch.com/t/361186/Servlets/java/Passing-String-jsp-servlet
and people have started replying to it.
[ September 20, 2005: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
 
subject: Pass a String array from a jsp to a servlet
 
Similar Threads
Retreiving data
Retreiving data
Getting months from date
Calendar class
Submit and Excel buttons and my Jsp