|
-
Jan 30th, 2007, 05:24 AM
#1
Thread Starter
Lively Member
[RESOLVED] Navigation between jsp and java servlet.
I am calling a servlet from a jsp. I want the result from the servlet back into the calling JSP. How do I do this?
-
Jan 30th, 2007, 09:02 AM
#2
Re: Navigation between jsp and java servlet.
How are you calling, and what is the result of the servlet?
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 31st, 2007, 12:09 AM
#3
Thread Starter
Lively Member
Re: Navigation between jsp and java servlet.
I am using the action attribute of the Form tag to go to the servlet. The servlet connects to the database, retrieves data. Now i want this data back into the calling jsp.
-
Jan 31st, 2007, 03:28 AM
#4
Re: Navigation between jsp and java servlet.
So it is really the client submitting a form to a servlet?
You could put the data into request attributes and then forward to the JSP. See javax.servlet.RequestDispatcher.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Feb 1st, 2007, 08:38 AM
#5
Thread Starter
Lively Member
Re: Navigation between jsp and java servlet.
I have used response.sendRedirect() to send Data through the URL. I pick up the data using request.getParamater() from the JSP.
Thanks for your help CornedBee.
-
Feb 1st, 2007, 08:54 AM
#6
Re: [RESOLVED] Navigation between jsp and java servlet.
Don't use sendRedirect(). It gives an inappropriate HTTP code.
Use the sendResultRedirect() method I presented in this thread:
http://www.vbforums.com/showthread.php?t=450148
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|