How to tell web.xml that it should not handle .htc files and so leave them to the web server?
How to t开发者_如何学编程ell web.xml that it should not handle .htc files and so leave them to the web server?
How can I do that ?
I am using Vaadin and it's servlet gets all requests, but I really need to serve a .htc file to fix IE(Dawn you Microsoft) corners and make them look better.
How to do that ?
Vaadin Servlet Mapping
> <servlet-mapping> > <servlet-name>vaadinServlet</servlet-name> > <url-pattern>/*</url-pattern> > </servlet-mapping>
Servlet
> <servlet>
> <servlet-name>vaadinServlet</servlet-name>
> <servlet-class>com.vaadin.terminal.gwt.server.GAEApplicationServlet</servlet-class>
<init-param>
> <description>
> Application widgetset</description>
> <param-name>widgetset</param-name>
> <param-value>web.googlemapwidget.Widgetset</param-value>
> </init-param> </servlet>
<servlet-mapping>
<servlet-name>vaadinServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<!-- servlet-name>staticServlet</servlet-name --> <!-- removed as suggested by raymi -->
<url-pattern>/*.htc</url-pattern>
</servlet-mapping>
Notice that the url-pattern
for vaadinServlet is changed from /*
to /
, which is the default mapping. It means if no other pattern is matched then use this servlet. Here is a quick reference I wrote about the url pattern mapping.
<!-- removed as suggested by raymi -->
<!--servlet>
<servlet-name>staticServlet</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
</servlet-->
In case you do not want your staticServlet to depends on the servlet containter, read this.
精彩评论