public class SampleServlet extends HttpServlet {
private String testParam;
public void init( ServletConfig config ) throws ServletException {
super.init(config);
testParam = config.getInitParameter("testParam");
}
public void doGet( HttpServletRequest request, HttpServletResponse response )
throws ServletException,IOException {
response.setContentType("text/html;charset=Windows-31J");
PrintWriter out = response.getWriter();
out.println("<html><body>");
out.println("testParam=" + testParam);
out.println("</body></html>");
}
}
|