public class SampleServlet extends HttpServlet {
public void doGet( HttpServletRequest request,
HttpServletResponse response )
throws ServletException,IOException {
request.setAttribute("data","request-data");
response.setContentType("text/html;charset=Windows-31J");
PrintWriter out = response.getWriter();
out.println("<html><body>");
out.println("data=" + request.getAttribute("data"));
out.println("</body></html>");
}
}
|