Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JSP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Tim Cooke
Campbell Ritchie
paul wheaton
Ron McLeod
Devaka Cooray
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Paul Clapham
Saloon Keepers:
Tim Holloway
Carey Brown
Piet Souris
Bartenders:
Forum:
JSP
communication Between two servlets
abinash das
Ranch Hand
Posts: 52
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
How can i pass some value from a
servlet
to a
JSP
if the request dispatch mode is
response.sendRedirect.
Ankit Garg
Sheriff
Posts: 9708
43
I like...
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You can add parameters to the url that you give in the sendRedirect method like this
response.sendRedirect("/myPage.jsp?param="+myParam);
Or you can set the value in a session attribute and retrieve it in the other servlet but for that you'll have to encode the redirect url with the session id
response.sendRedirect(reponse.encodeRedirectURL("/myPage.jsp"));
SCJP 6 | SCWCD 5 |
Javaranch SCJP FAQ
|
SCWCD Links
abinash das
Ranch Hand
Posts: 52
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
In the given techinque
i,e response.sendRedirect(reponse.encodeRedirectURL("/myPage.jsp"));
how can i pass values to myPage.jsp.
maens how to define and set values and how to get these values at myPage.jsp
Bauke Scholtz
Ranch Hand
Posts: 2458
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
When redirecting, pass it as request parameters (visible in URL).
When forwarding, pass it as request attributes (hidden from URL).
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
how to pass some variables to jsp from servlet using RequestDispatcher
servlet to servlet communication
applet or jsp for comm with servlet ?
c:set equivalent in struts tag ?
Notify JSP that ServletContext been changed?
More...