I get some question today.
This below is my servlet-mapping contents of web.xml
<servlet>
<servlet-name>static-resource</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>static-resource</servlet-name>
<url-pattern>/statis-resource/*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
My application directory structure is:
/WEB-INF
/static-resource
I hope to this
This case of the request is mapping to
static-resourceservlethttp://myserver/static-resource/test.jshttp://myserver/static-resource/images/img1.jpghttp://myserver/static-resource/test.xml
And this case of the request is mapping to
dispatcherservlethttp://myserver/other/whole/uri
But, my web.xml is whole of the request mapping to dispatcher servlet directly.
Below is my glassfish server log on request
[#|2014-10-28T09:54:27.722+0900|WARNING|glassfish3.1|org.springframework.web.servlet.PageNotFound|_ThreadID=680;_ThreadName=Thread-1;|No mapping found for HTTP request with URI [/static-resource/test.js] in DispatcherServlet with name 'dispatcher'|#]
So, I wondered, why whole of requests are mapped to dispatcher servlet?
Anyone help me?
Update
Sorry my misstake, I correct misstype but still response 404 error. Hmm... probably have another problems?
statis-resourceinstead ofstatic-resource? - Robby Cornelissen