Solved

Redirecting response, request from POST to GET within JSP

Posted on 2004-08-08
5
253 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 300 total points
Comment Utility
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
Comment Utility
This is exactly I was looking for! Thank you!
0
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
Comment Utility
:)
0
 

Author Comment

by:brige03
Comment Utility
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
Comment Utility
Could you dump your code in part of redirect to servlet C?
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

HOW TO: Install and Configure VMware vSphere Hypervisor 6.5 (ESXi 6.5), Step by Step Tutorial with screenshots. From Download, Checking Media, to Completed Installation.
Veeam Backup & Replication has added a new integration – Veeam Backup for Microsoft Office 365.  In this blog, we will discuss how you can benefit from Office 365 email backup with the Veeam’s new product and try to shed some light on the needs and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

762 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now