Snooper Servlet

The goal of this assignment is to begin writing Java servlets. The emphasis will be on locating the various APIs and exploring options for obtaining various HTTP parameters.

Write a "snooper" servlet, similar to the CGI program written in the Introduction to WWW Programming course, that returns HTML-formatted data to the user's WWW browser. It should function for both GET and POST methods.

The servlet should provide the following information:

URL:

http://wwwj.cs.unc.edu:8888/jbs/servlet/jbsGetPostEcho

HTTP Header Variables:

Request protocol: HTTP/1.1
Request method: GET
Remote host: 152.2.142.120
Remote address: 152.2.142.120
Content type: null
Content length: -1
Query string: name=jbs
Server name: wwwj.cs.unc.edu
Server port: 8888
Request URI: /jbs/servlet/jbsGetPostEcho
Servlet path: /servlet/jbsGetPostEcho

Query String Attribute/Value Pairs:

name: jbs
    
 

Run the servlet.