public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
String requestURI = getRequestURI(request);
FacesContext fc = getFacesContext(request, response);
NavigationHandlerBean navigationHandler = (NavigationHandlerBean) fc.getApplication().getELResolver().getValue(fc.getELContext(), null, "navigationHandler");
if (getDemoType(requestURI).equals(TYPES.component)){
IComponentVariantDemo componentVariantDemo = getComponentVariantDemo(requestURI);
navigationHandler.setCurrentComponentVariantDemo(componentVariantDemo);
_LOG.log(Level.INFO,"Forwarding request [" + requestURI + "] to view [" + componentVariantDemo.getEntryPagePath()+"]");
if (!response.isCommitted()) {
request.getRequestDispatcher("/faces"+componentVariantDemo.getEntryPagePath()).forward(request, response);
}
}
if (getDemoType(requestURI).equals(TYPES.feature)){
IFeatureDemo featureDemo = getFeatureDemo(requestURI);
navigationHandler.setCurrentFeatureDemo(featureDemo);
_LOG.log(Level.INFO,"Forwarding request [" + requestURI + "] to view [" + featureDemo.getPagePath()+"]");
if (!response.isCommitted()) {
request.getRequestDispatcher("/faces"+featureDemo.getPagePath()).forward(request, response);
}