File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Passing a String from jsp to servlet
Joined: Sep 27, 2004
Sep 19, 2005 05:08:00
I have a
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 RequestDispatcher 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 JSP 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.
I agree. Here's the link:
subject: Passing a String from jsp to servlet
Tomcat 4.1.24 compile problems
images display problem with dispatcher.forward()
Where can I find 'POST' Request String?
RequestDispatcher and Blank Page
forwarding the request ?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015