It's not a secret anymore!*
The moose likes JSP and the fly likes Issue in returning 302 response code instead of 200 response code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Issue in returning 302 response code instead of 200 response code" Watch "Issue in returning 302 response code instead of 200 response code" New topic
Author

Issue in returning 302 response code instead of 200 response code

Mike Thomson
Ranch Hand

Joined: Nov 07, 2007
Posts: 115
While submitting the form and if the http method is POST, then instead of returning 200 response code, I will be redirecting to dummy/temp page from which it will be directed to required page, so that we will return 302 response code to avoid the caching of senstivie information.

This is working fine and in one place it's giving some strange error which is working fine without the above logic.

My dummy jsp page will have the following code for redirection.


For example:

Actual page to be redirect from servlet: empSuccess.jsp

In "empSuccess.jsp", I am using the above code for redirection to emp.jsp. It's redirecting propely and working fine. But in my emp.jsp, I am using the below javascript for excel download.
Below methos will open a popup window to display the message to the user that it's about to download the report and the form will be submitted for the biz logic. The form submission is working fine, but the download.jsp page is not diaplying and returing 404 error.

But if I am not usinf the above logic (200 instead od 302 rsp code), the download.jsp pasge is displaying properly. Any suggestion/idea on why it's not working?

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Issue in returning 302 response code instead of 200 response code