How to exclude css mime type ?

141 views
Skip to first unread message

Guillaume MAKA

unread,
Dec 14, 2011, 12:19:08 PM12/14/11
to SiteMesh 3 Users
I've a problem with the sitemesh 2.4 when I try to retrieve local css
stylesheet in my JSP files with the <rel /> tag. Safari say me it
requested with the correct text/css mime-type but get text/html
response in place.

My CSS declaration:

<link type="text/css" rel="stylesheet" href="/MyApp/assets/css/
bootstrap.css">
<link type="text/css" rel="stylesheet" href="http://localhost:8888/
MyApp/assets/css/bootstrap.css">

This is my decorators.xml files

<decorators defaultdir="/template">
<decorator name="layout" page="layout.jsp">
<pattern>/*</pattern>
</decorator>
<excludes>
<pattern>/assets/*</pattern> <---- Contains css and js dir
</excludes>
</decorators>

This is my web.xml files

<web-app>
<display-name>MyApp</display-name>
<servlet>
<servlet-name>Jersey Web Application</servlet-name>
<servlet-class>
com.sun.jersey.spi.container.servlet.ServletContainer
</servlet-class>
<init-param>
<param-name>com.sun.jersey.api.json.POJOMappingFeature</param-
name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>Jersey Web Application</servlet-name>
<url-pattern>/resources/*</url-pattern>
</servlet-mapping>
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>
com.opensymphony.module.sitemesh.filter.PageFilter
</filter-class>
<init-param>
<param-name>debug.pagewriter</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>

I think the problem it's the filter catch all content-type instead
catch only the html content type.

If someone can help me to solve this behavior.

Thanks

phamti

unread,
Oct 3, 2012, 10:00:41 PM10/3/12
to sitemes...@googlegroups.com
Hi Guillaume,

Are you still having this problem or did you resolve it? Let me know and I can take a closer look and to help you out.

Tin
Reply all
Reply to author
Forward
0 new messages