• Post Reply Bookmark Topic Watch Topic
  • New Topic

Pass a String array from a jsp to a servlet

 
JayaSiji Gopal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!