Here is the code I found in a manual written at the time of Tomcat 6:

The code belongs to a servlet. There is no index.jsp file nor order.html
file.

String message;
        /*
         * Initializing the message to display : If one of the mandatory
fields
         * is not filled, then we display an error message
         * else we display a success message
         */
        if ( name.trim().isEmpty() || address.trim().isEmpty() ||
telephone.trim().isEmpty() || amount == -1 ) {
            message = "Error - You did not fill all the mandatory fields.
<br> <a href=\"createOrder.jsp\">Click here/a> to access the order form.";
        } else {
            message = "Order successfuly created !";
        }

So when I run the project with Tomcat 7 as target, the url :
"createOrder.jsp" points to an empty form the first time.
But Tomcat 7 returns an error stating that it can't find the jsp.
If I comment out the if.. else test and add some pipes with afile.html and
index.jsp, the application works.
I don't know how to replace the test for Tomcat 7
I'll try to give "name" a value like "ZZZZZ" and test it as you advise.


On Wed, Feb 12, 2014 at 9:32 PM, Leo Donahue <donahu...@gmail.com> wrote:

> On Wed, Feb 12, 2014 at 1:10 PM, JB MORLA <jbmo...@gmail.com> wrote:
> > If there is a field called "username", in a form with url "registration"
> ,
> > how can I display the form the first time in Tomcat 7? (When the field is
> > empty)
>
>  initialize the username property?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

Reply via email to