public class SampleServlet extends HttpServlet {
public void doGet( HttpServletRequest request, HttpServletResponse response )
throws ServletException,IOException {
ServletContext context = this.getServletContext();
response.setContentType("text/html;charset=Windows-31J");
PrintWriter out = response.getWriter();
out.println("<html><body>");
Enumeration e = context.getInitParameterNames();
while(e.hasMoreElements()) {
String name = (String)e.nextElement();
out.println(name + "=" + context.getInitParameter(name));
}
out.println("</body></html>");
}
}
|