Framework & Platform/Spring

spring mvc - No mapping found for HTTP request with URI

linuxism 2012. 5. 10. 13:00

Spring MVC에서

아래와 같이 이클립스에서 에러를 출력하였다.

No mapping found for HTTP request with URI [/images/main_bg.png] in DispatcherServlet with name 'appServlet'

or

No mapping found for HTTP request with URI [/favicon.ico] in DispatcherServlet with name 'appServlet'


web.xml에서 url-pattern를 /로 했던게 문제인 것 같다.

<servlet-mapping>

    <servlet-name>appServlet</servlet-name>

    <url-pattern>/</url-pattern>

</servlet-mapping>


*.do url-pattern만 spring에서 처리 하도록 수정 후 에러 출력 없음.

<servlet-mapping>

    <servlet-name>appServlet</servlet-name>

    <url-pattern>*.do</url-pattern>

</servlet-mapping>