A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Node.js in Action
this week in the
Passing a String from jsp to servlet
Joined: Sep 27, 2004
Sep 19, 2005 05:08:00
I have a jsp page, where I am setting a
 as a request attribute.
In the corresponding
, I say request.getAttribute("key") -> I get Null Pointer Exception.
I tried using
rd = request.getRequestDispatcher("relative path"); -- line 1
After putting the above two lines, the jsp page isnt rendered properly and gives a Translation error.
My servlet is in a package a.b.c.Servlet.java. How do I give this path in line 1.
SCJP 1.4, SCWCD 1.4<br /> <br />Thanks in advance!<br />Jayashree.
Joined: Sep 11, 2005
Sep 19, 2005 06:00:00
Give the URL mapping that's valid for this servlet as specified in web.xml
keep smilin :: sravan<br /><a href="http://sravanpens.blogspot.com" target="_blank" rel="nofollow">I scribble here</a>
Joined: Dec 11, 2004
Sep 19, 2005 06:16:00
Are you trying to pass the value from the webpage back to the server this way?
How are you getting from your
to the servlet?
How to ask a question...
Simple Servlet Examples
Joined: Oct 07, 2004
Sep 19, 2005 06:27:00
why r u store String in attribute??
just use request.getParameters() in servlet from jsp.
Don't get me started about those stupid
subject: Passing a String from jsp to servlet
forwarding the request ?
Tomcat 4.1.24 compile problems
Where can I find 'POST' Request String?
RequestDispatcher and Blank Page
images display problem with dispatcher.forward()
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014