开发者

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.

You will need to define your static servlet. This depends on your servlet container. For tomcat,
<!-- 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜