-
1. Re: How to remove jsessionid from .xcss includes in richfaces
kchintoju Aug 22, 2010 9:39 PM (in response to kchintoju)Ok, a late post. But might help anyone still looking for this.
I raised this issue with jboss support as we have jboss developer support center. And below is their answer verbatim.
(NOTE: The replies themsevles are old
Reply 1(10/30/2009 10:10 AM EDT)
----
There appears to be no configuration option for this.
One approach to solving the problem is to extract the xcss files from the richfaces jar files and reference them manually. This would require the modification of the components xml:
org.richfaces.LoadStyleStrategy
NONEThe down side to this is ALL style sheets will no longer be included automatically and will need to be specified manually. Not entirely desirable.
Reply 2 (11/11/2009 3:01 PM EST)
----
There is no configuration option available at this time. The template css is designed as a "session aware" resource.
If you use the "NONE" loading strategy for your scripts and styles. You can write a custom Seam filter to set the expiration time at the http header as Richfaces filter does for its resources.
Here is a simple example just to give you an idea.
@Startup
@Scope(ScopeType.APPLICATION)
@Filter(within="org.jboss.seam.web.ajax4jsfFilter")
@BypassInterceptors
@Name("mySeamFilter")
public class MySeamFilter extends AbstractFilter {
private static long DEFAULT_EXPIRE = 1000L * 60L * 60L * 24L;
public void doFilter(final ServletRequest request, final ServletResponse
response,final FilterChain chain) throws IOException,ServletException {
HttpServletResponse res = (HttpServletResponse) response;
String requestUri = req.getRequestURI();if(requestUri.endsWith(".css") || requestUri.endsWith(".js") ) {
long ifModifiedSince = req.getDateHeader("If-Modified-Since");
if (ifModifiedSince >= 0) {
res.setStatus(304);
}
else {//the first time to set the header
res.setDateHeader("Expires",
System.currentTimeMillis()+DEFAULT_EXPIRE);
}
}
chain.doFilter(request, response);
}
}