Servlet클래스는HttpServlet를 상속 받음1
2
3
4
5("/Hworld")
public class Helloworld extends HttpServlet {
private static final long serialVersionUID = 1L;
...
}요청처리객체 및 응답처리객체를 톰캣에서 받음
1
2
3protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.getWriter().append("Served at: ").append(request.getContextPath());
}get방식,post방식 -form태그method속성값doGet호출 : URL값으로 정보가 전송되어 보안에 약함doPost호출 :header를 이용해 정보가 전송되어 보안에 강함
doGet()html내form태그의method속성이get일 경우 호출- 웹브라우저 주소창을 이용하여
servlet을 요청하면 호출
doPost()html내form태그의method속성이post일 경우 호출
Context PathWAS(Web Application Server)에서 웹애플리케이션을 구분하기위한 Path- 이클립스에서 프로젝트를 생성하면 자동으로
server.xml에 추가
| Home | Archives | Categories | Tags | About |
|