Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-15-2008, 04:38 PM
Member
 
Join Date: Jan 2008
Posts: 17
gapper is on a distinguished road
Servlet calling JSP page
How can I call a JSP page from a Servlet. I have the required data in session variables, and want to access that data from JSP. I don't know how to redirect to JSP page. Please give sample.

Thanks.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 01-15-2008, 05:00 PM
Senior Member
 
Join Date: Jun 2007
Location: Bali, ID
Posts: 100
wsaryada is on a distinguished road
You can either use the HttpServletResponse.sendRedirect() method or using HttpServletRequest.forward() method. This two method have a different behavior. The sendRedirect() will cause a browser to initiate a new request to the server, this means you have to keep your data so it will arrive on the next target page, for example you can keep the data in session scope.

While the forward method will just forward the request to another target without asking the browser to initiate a new request, or the browser didn't know that you request is processed in another page.
__________________
Website:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
- Blog:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to load a servlet on index.jsp page... sujithc34 Java Servlet 1 01-19-2008 01:28 AM
MIDLet calling Servlet ravian Java Servlet 1 12-06-2007 01:48 PM
Calling a Jython script from a Java Servlet returns incomplete output bthakur Java Servlet 0 11-13-2007 01:41 PM
javax.servlet.ServletException: Wrapper cannot find servlet class util.t2 osval Advanced Java 1 08-07-2007 04:47 PM
Help with Calling a method Albert New To Java 3 07-10-2007 04:27 PM


All times are GMT +3. The time now is 09:02 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org