import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class CGIVar extends HttpServlet
{
	public void doGet(HttpServletRequest request,HttpServletResponse response)
			throws ServletException,IOException {
		String [][]cgi={	{"AUTH_TYPE", request.getAuthType()},
							{"CONTENT_LENGTH", String.valueOf(request.getContentLength())},
							{"CONTENT_TYPE", request.getContentType()},
							{"QUERY_STRING", request.getQueryString()},
							{"REMOTE_ADDR",  request.getRemoteAddr()},
							{"REMOTE_HOST",  request.getRemoteHost()},
							{"REMOTE_USER",   request.getRemoteUser()},
							{"REQUEST_METHOD",request.getMethod()},
							{"SERVER_NAME",   request.getServerName()},
							{"SERVER_PORT",   String.valueOf(request.getServerPort())},
							{"SERVER_PROTOCOL", request.getProtocol()}};
		response.setContentType("text/html");
		PrintWriter out = response.getWriter();
		for(int i=0; i<cgi.length; i++) {
			out.println(cgi[0] +" = "+ cgi[1] +"<BR>");
		}
	}
}
