Copyright (c) SEMM NL All rights reserved.
Author : Paul Hamaker. Part of JavaLessons.com

Heart of the matter.

This servlet just sends back the data entered/chosen by the user.

In formpost.html we find this URL ....

and the preferred way to send HTML FORM contents.

The URL refers to servlet srdue, known to Tomcat.

The browser sends the form contents to the HTTP-server using a HTTP POST request, when the user clicks the SUBMIT button ....

and the HTTP-server passes it on to the servlet.

The class ServDue contains the servlet's logic.

In its doPost method the form contents is retrieved, ....

where the names are especially important .

The servlet passes the data embedded in HTML to the HTTP-server, which, in its turn, sends it back to the client.

On the browser side this could look as shown in the pictures.

===============

Several wars and jars can be zipped into one Enterprise Archive, ear .

It has to contain a META-INF directory containing the file application.xml.

Now we can use a different URL....

instead of this one.

Same.

=======

NOTES

=======

In JBoss, files don't have to be zipped, having the required directory tree is sufficient.

So these will be directories instead of ZIP-files.

=======

With multiple buttons it's easy to determine which one was clicked. In HTML you add NAME attributes to the buttons so you can code :
if ( req.getParameter ( "firstbutt" ) != null )

If true, that means it was clicked.

.