DirectURLServlet.java
페이지 정보
작성자 관리자 작성일 21-07-15 18:33 조회 544 댓글 0본문
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/DirectURLServlet")
public class DirectURLServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
public DirectURLServlet() {
super();
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String name = request.getParameter("name");
String age = request.getParameter("age");
response.setContentType("text/html;charset=utf-8");
PrintWriter out = response.getWriter();
out.println("이름 : " + name + "<br>");
out.println("나이 : " + age + "<br>");
}
}
댓글목록 0
등록된 댓글이 없습니다.