I think that forward is an internal redirection in the server, so the client
browser still sees the same original url.
Check it searching the word "forward" in www.jspinsider.com for more info.
Hope it helps.
----- Original Message -----
From: Shashwati Panigrahi <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 01, 2001 9:36 PM
Subject: Re-execution of servlet
> Hi All,
>
> I am describing my situation below.
> I have a page called AddTicket.jsp, which sends all the ticket related
data
> entered by the user to the servlet AddTicket.java.
>
> Now AddTicket.java creates a new ticket id by fecthing the maximum ticket
id
> from the database and adding 1 to it.
>
> Then AddTicket.java inserts the record which consists of parameters
received
> from the jsp as well as the ticket_id generated. If the insert is
successful
> then it sends a message to the message page using the following code
>
> ServletContext sc=getServletContext();
> RequestDispatcher rd = sc.getRequestDispatcher(/jsp/Message.jsp);
> rd.forward(req,res);
>
> Now when the record is inserted then the Message is displayed on the
message
> page whereas the URL on the browser is still that of the servlet.
>
> When I press F5 at this juncture, the servlet AddTicket re-executes thus
> creating another record with the next ticket id but all the data is same
as
> the previous one. I want to prevent executing this servlet at this point
> when I refresh the page. What should I do and how should I go about it.
>
> I hope someone can help me fast
>
> Thanks in Advance
> Shashwati
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets