You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Odo <go...@heaven.club.ne.jp> on 2002/02/07 03:06:08 UTC

Default servlet

How  force Tomcat4 to call default page
from index.jsp  to index.class(Servlet)?
Any settings in web.xml?If so how?


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: how to prevent hitting back button and re-executing code?

Posted by Richard P <rp...@yahoo.com>.
Pass value either in a hidden form field or appended
to the URL like submitID=SOMERANDOMID.

Upon processing the form, first check to see if
SOMERANDOMID has already been saved to a
cookie/session variable.  If yes, error message "This
form has already been submitted".  otherwise, save
SOMERANDOMID to the session or in a cookie.

I like to leave a submit_it_again_anyways link for
power users.

--- C Cayetano <ap...@ccayetano.com> wrote:
> All,
> 
> Problem:
> I've got a name.jsp page which has a form to get
> lastname, firstname,
> address, etc.
> On submit the form is sent to a servlet for adding
> into the database
> (primary key field is an incremental record ID)
> Once processed the servlet redirects to a
> confirmation.jsp page
> Now if the the user hits the back button, which pops
> a 'retry' dialog box,
> and the user hits retry button, the whole add
> process is executed again and
> the same lastname, firstname, address, etc. is
> entered into the database,
> basically creating duplicate records.
> 
> Is there a way to prevent this?
> 
> Thanks
> 
> 
> --
> To unsubscribe:  
> <ma...@jakarta.apache.org>
> For additional commands:
> <ma...@jakarta.apache.org>
> Troubles with the list:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


how to prevent hitting back button and re-executing code?

Posted by C Cayetano <ap...@ccayetano.com>.
All,

Problem:
I've got a name.jsp page which has a form to get lastname, firstname,
address, etc.
On submit the form is sent to a servlet for adding into the database
(primary key field is an incremental record ID)
Once processed the servlet redirects to a confirmation.jsp page
Now if the the user hits the back button, which pops a 'retry' dialog box,
and the user hits retry button, the whole add process is executed again and
the same lastname, firstname, address, etc. is entered into the database,
basically creating duplicate records.

Is there a way to prevent this?

Thanks


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Default servlet

Posted by Odo <go...@heaven.club.ne.jp>.
Is it possible without redirecting and doing any settings in server.xml?

Is there any trcicks to be java servlet as default "welcome" file
instead of index.jsp?

Galbayar wrote:

> index.jsp redirect to your servlet
> 
> ----- Original Message ----- 
> From: "Odo" <go...@heaven.club.ne.jp>
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Sent: Thursday, February 07, 2002 10:06
> Subject: Default servlet
> 
> 
> 
>>How  force Tomcat4 to call default page
>>from index.jsp  to index.class(Servlet)?
>>Any settings in web.xml?If so how?
>>
>>
>>--
>>To unsubscribe:   <ma...@jakarta.apache.org>
>>For additional commands: <ma...@jakarta.apache.org>
>>Troubles with the list: <ma...@jakarta.apache.org>
>>
>>
>>
> 
> 
> 
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
> 
> 
> 



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Default servlet

Posted by Galbayar <ga...@mobicom.mn>.
index.jsp redirect to your servlet

----- Original Message ----- 
From: "Odo" <go...@heaven.club.ne.jp>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Thursday, February 07, 2002 10:06
Subject: Default servlet


> How  force Tomcat4 to call default page
> from index.jsp  to index.class(Servlet)?
> Any settings in web.xml?If so how?
> 
> 
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
> 
> 
> 



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>