import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class Properties extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException,
IOException {
PrintWriter out = resp.getWriter();
out.println("");
out.println("");
out.println("");
out.println("Method ");
out.println("" + req.getMethod() + " ");
out.println(" ");
out.println("");
out.println("User ");
out.println("" + req.getRemoteUser() + " ");
out.println(" ");
out.println("");
out.println("Client ");
out.println("" + req.getRemoteHost() + " ");
out.println(" ");
out.println("");
out.println("Protocol ");
out.println("" + req.getProtocol() + " ");
out.println(" ");
java.util.Enumeration e = req.getParameterNames();
while (e.hasMoreElements()) {
String name = (String) e.nextElement();
out.println("");
out.println("Parameter '" + name + "' ");
out.println("" + req.getParameter(name) + " ");
out.println(" ");
}
out.println("
");
out.println("");
out.println("Server Properties
");
out.println("
");
out.println("");
java.util.Properties props = System.getProperties();
e = props.propertyNames();
while (e.hasMoreElements()) {
String name = (String) e.nextElement();
out.println("");
out.println("" + name + " ");
out.println("" + props.getProperty(name) + " ");
out.println(" ");
}
out.println("
");
out.println("");
out.flush();
}
public void init() throws ServletException {
ServletConfig config = getServletConfig();
}
public void destroy() {
}
}