2013년 1월 13일 일요일

@WebServlet annotation with Tomcat 7 and 404 error

@WebSerlvet annotation 을 사용해서 servlet 을 정의했지만 404 에러가 발생했다.
문제는 web.xml 파일에 metadata-complete 를 true 로 설정했기 때문이었다.

아래와 같이 metatdata-complete 를 false 로 설정해야 했다.

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
metadata-complete="false"
version="3.0">

!) eclipse 에서 프로젝트를 clean 하고 다시 build 해야 할 수도 있다.

댓글 없음:

댓글 쓰기