-
1. Re: Filtering the integration of richfaces
ilya_shaikovsky May 12, 2010 9:19 AM (in response to edouqrd)set
org.richfaces.LoadStyleStrategy
and
org.richfaces.LoadScriptStrategy
to NONE.
-
2. Re: Filtering the integration of richfaces
edouqrd May 14, 2010 3:33 PM (in response to ilya_shaikovsky)Hello,
I'm sorry for the duplicate post, I saw this one after posting: http://community.jboss.org/thread/151559?tstart=30
which basically answered my question. My problem now, is to include the right scripts and styles from richfaces, from the part of my project that need it.
check loadStyle loadScript at richfaces-demo. them designed to fetch resources from jar's so you will be able to load our scripts and styles manually where need.
I didn't find these load methods, and it sounds like I have to find which component use which script / style. Is there a way or reference to know that? And can you indicate me please where those methods are described?
Thank you very much
-
3. Re: Filtering the integration of richfaces
nbelaevski May 14, 2010 5:31 PM (in response to edouqrd)Hi Edouard,
Check this plugin: http://community.jboss.org/wiki/MavenResourceDependencyPluginReference
-
4. Re: Filtering the integration of richfaces
edouqrd Jun 10, 2010 5:19 PM (in response to nbelaevski)Hi, thank you for your help.
I finally figured out a simple way of really filtering the use of RichFaces. I just created a simple filter, replaced the org.ajax4jsf.Filter with this one, and I'm making a conditionnal call to it if I need it. As I described before, I just need to get ride of it for my mobile subdomain, so my condition is really simple:
public class RichFacesFilter implements javax.servlet.Filter{
// The richfaces filter
private org.ajax4jsf.Filter richfacesFilter;
public void init(FilterConfig filterConfig) throws ServletException {
// Initiating the richfaces filter
richfacesFilter = new org.ajax4jsf.Filter();
richfacesFilter.init( filterConfig );
}
public void destroy() {
// destroy the filter
richfacesFilter.destroy();
richfacesFilter = null;
}
public void doFilter(ServletRequest req, ServletResponse rep,
FilterChain chain) throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest) req;
String page = request.getRequestURI();
// IS PAGE FROM MOBILE SUBDOMAIN?
if( ! page.toLowerCase().contains("/mobile/") )
// NO: we run the richfaces filter
richfacesFilter.doFilter( req , rep , chain );
else
// YES: We don't run the richfaces filter
chain.doFilter( req , rep );
}
}
I hope it might help someone.