Created
May 7, 2014 07:27
-
-
Save sjyun/f5510acf1d7952920f63 to your computer and use it in GitHub Desktop.
servlet3.0 annotation ex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.IOException; | |
| 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(name="HelloServlet", urlPatterns ={"/hello"} ) | |
| public class HelloServlet extends HttpServlet { | |
| private static final long serialVersionUID = 1L; | |
| //생성자 | |
| public HelloServlet() { | |
| super(); | |
| } | |
| public void init() throws ServletException { | |
| System.out.println("init"); | |
| } | |
| protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | |
| System.out.println("do Get 메소드 호출"); | |
| } | |
| protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | |
| System.out.println("doPost 메소드 호출"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment