오류/Server

Server, Error / com.hello.HelloServlet.class:1 Failed to load resource: the server responded with a status of 404 ()

greenyellow-s 2024. 9. 9. 22:03
xml 파일
<servlet>
	<servlet-name>HelloServlet</servlet-name>
	<servlet-class>com.hello.HelloServlet.class</servlet-class>
</servlet>

<servlet-mapping>
	<servlet-name>HelloServlet</servlet-name>
	<url-pattern>/HelloServlet</url-pattern>
</servlet-mapping>

에러문구
com.hello.HelloServlet.class:1 Failed to load resource: the server responded with a status of 404 ()

의미

 

주소가 틀렸다.

404 에러는 주소가 틀려서 나타나는 에러 문구이다.


해결방법

 

틀린 주소를 찾아야한다.

 

xml 파일 만들때 servlet-class 주소를 잘못 적었다.

<servlet-class>com.hello.HelloServlet.class</servlet-class>

 

class 파일이지만 .class는 생략해서 적어야한다.

<servlet-class>com.hello.HelloServlet</servlet-class>

 

해결완료~