Servlet using Links and the GET-Method

The purpose of this assignment was to:

The description and my solution of the Links and the GET-Method Servlet -assignment can be viewed and/or downloaded at the bottom of this page.

What is the GET Method and when is it used?

The GET-method is a type of request(method) for requesting pages from a Web server. It uses the environmental variable QUERY_STRING.

GET is the method used when you type a URL address directly in your browsers address bar, or click on a link.

When using a HTML form either the GET-method or the POST-method can be used.

GET is, however, not a secure way to transmit HTML form data since the data sent from a Web browser is appended to a string of characters visible in the browser address bar.

This is an example of what it can look like:

somepage.jsp?forename=ernest& lastname=hemingway&address=key_west

As you can see in the example above, input values are sent as part of the URL in the section of the URL preceding the question mark with every value separated by the & sign. The server-side application can get to this information by using the environment variable QUERY_STRING.

Assignment Description

Create a HTML document with a link to a servlet on the server-side. The link should hava a name parameter and a value for this parameter.

Create the servlet that should retreive this information and send it back to the Web browser when the link is clicked.

My Solution, Assignment Files

Try the Links, GET Method Servlet

«  Previous Next  »