wood burning stoves
The moose likes Servlets and the fly likes redirection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "redirection" Watch "redirection" New topic


A Babu
Ranch Hand

Joined: Nov 28, 2005
Posts: 114
Below is my servlet now i want to redirect to form (view.jsp)if the data coming from the form is same as previous request.

how we can do redirection in this case.please give me suggestion with sample code of line.


Bruno Boehr

Joined: Feb 15, 2006
Posts: 17
A Babu,

It is not quite clear from your post exactly what you are trying to do:

> now i want to redirect to form (view.jsp)

Did you mean redirect or forward? Is your form's name view.jsp? But you are already forwarding (unconditionally) to /view.jsp in both doPost() and doGet() methods.

> if the data coming from the form is same as previous request

Let me guess: are you trying to prevent double postings? Well, if that's the case, there are a number of techniques to do that. But first, let's make sure we are on the same page here.

<a href="http://webjavenue.com/" target="_blank" rel="nofollow">Your first website in Java: easier than you think</a>
I agree. Here's the link: http://aspose.com/file-tools
subject: redirection
It's not a secret anymore!