Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Redirecting response, request from POST to GET within JSP

Posted on 2004-08-08
5
Medium Priority
?
265 Views
Last Modified: 2010-04-01
Hi,

I have a JSP A which is listening for a request then it forwards it to servelt A (I just have <jsp:include></jsp> tag). Then servelt A process the request and parameters then displays the result back to JSP A. Now the way I have written my servlet A I am using doGet method to process all the parameters. I am using doPost for some other routines.
The third party App will post their results to my JSP A with the POST method. How can I get all the prameters and then redirect them to my servlet's A doGet method?

Please provide some concreate examples! Thank you in advance!

Gene.
0
Comment
Question by:brige03
  • 3
  • 2
5 Comments
 
LVL 11

Accepted Solution

by:
sompol_kiatkamolchai earned 1200 total points
ID: 11750176
The one simple solution is in the included jsp you add this code at the top of it.

request.setAttribute("doGet", "YES");

and in the doPost method of servlet file.

if(((String)request.getAttribute("doGet")).equalsIgnoreCase("YES")) {
  doGet(request, response);
}
0
 

Author Comment

by:brige03
ID: 11754031
This is exactly I was looking for! Thank you!
0
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11754074
:)
0
 

Author Comment

by:brige03
ID: 11897383
THE OBOVE WORKED JUST FINE!

However, I have an additional condition:

1) JSP page sends a POST request to my Servlet E

2) Servlet E listens for a specific parameter (see above thread) then it redirects it to its doGet method

3) doGet proccess the information and then at some point redirects the request to another Servlet C

Question:

Servlet C gets the request from servlet E just fine but it's doPost get's the response! I need to route it to doGet right away from servlet E. How can I do that?

Thanks.

Gene.
0
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11929024
Could you dump your code in part of redirect to servlet C?
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
Did you know there are services out there that can turn an Instagram feed into an RSS feed? I found some interesting exclusive Instagram content which I wanted to follow without signing up for yet another social media account. RSS to the rescue!
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Screencast - Getting to Know the Pipeline
Suggested Courses

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question