The simplest (perhaps not the best[?]) way to manage this is to set a
variable that indicates that the servlet is in the "data submission"
phase. Then use this to conditionally process/display you page. To use
psuedocode:
boolean phase2 = false;
String formPhase2 = res.getParameter("formTrue");
// should be "true" on form submit
phase2 = (new Boolean(formPhase2).booleanValue();
if (phase2)
{
// process form
}
else
{
// do nothing?
}
as far as displaying the submitted data in "non-editable text fields",
in your display you *could* use the same conditional to display the form
fields or the submitted values (there are of course other ways to do
this):
out.println("First Name: ");
if (phase2)
out.println(formValue1)
} else
out.println("<input type=text ... >");
}
Lance Lavandowska
Software Engineer
http://www.AgDomain.Com
-----Original Message-----
From: Duke Martin <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Sunday, May 23, 1999 9:14 PM
Subject: interesting form question????
>Hello,
>
>I have a very challenging question about forms. I am working on an
>interactive servlet that allows users to enter data into a text field,
>submit the data. The data is updated on the server and re-displayed on
the
>SAME FORM in a non-editable text field when the screen is refreshed. The
>problem I am having is that when the servlet is refreshed, the data that
was
>attached to the end of the url is re-submitted. This is causing major
>problems for me. If possible, I would like to be able to use the same
>servlet to generate the form fields and be able to process the data being
>entered and re-diplay the new data on the same form when refreshed. Does
>anyone know how this can be done? The servlet I currently have works
great
>except for the data re-submission problem. Any help is greatly
appreicated.
>
>Thanks
>Duke
>
>_________________________________________________________________________
__
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
>of the message "signoff SERVLET-INTEREST".
>
>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>Resources: http://java.sun.com/products/servlet/external-resources.html
>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html