This week's book / license giveaways are in the JDBC and Relational Databases and Java in General forums.
We're giving away four copies each of PostGIS in Action and Java Advanced Topics Training and have the authors on-line!
See this thread and this one for details.
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


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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pass a String array from a jsp to a servlet