import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class LoopServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doIt(request, response); } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doIt(request, response); } private void doIt(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("Shift_JIS"); response.setContentType("text/html; charset=Shift_JIS"); PrintWriter out = response.getWriter(); out.println(""); out.println(""); out.println("LoopServlet"); out.println(""); out.println(""); for (int i = 1; i <= 5; i++) { out.print("

Tv"); out.println(i); out.print("

"); } out.println(""); out.println(""); } }