Hi,
My problem is after the login the page is not decorated. I already searched the forums for the solution, but couldn't found any post that solves my probelm.
This is the code of the redirect:
Parts of my web.xml:Code:public String login() { // authentication stuff... SavedRequest savedRequest = (SavedRequest)session.getAttribute(AuthenticationProcessingFilter.ACEGI_SAVED_REQUEST_KEY); String targetUrl = (savedRequest != null) ? savedRequest.getRequestURI() : ""; if (!"".equals(targetUrl)) { session.removeAttribute(AuthenticationProcessingFilter.ACEGI_SAVED_REQUEST_KEY); SecurityMBean.log.info("targetUrl: " + savedRequest.getRequestURI()); String ctxPath = request.getContextPath(); int idx = targetUrl.indexOf(ctxPath); String target = targetUrl.substring(idx + ctxPath.length()); forward(target); } return outcome; } protected void forward(String viewId) { ViewHandler viewHandler = getApplication().getViewHandler(); FacesContext facesCtx = getFacesContext(); UIViewRoot view = viewHandler.createView(facesCtx, viewId); facesCtx.setViewRoot(view); facesCtx.renderResponse(); }
And my decorators.xmlCode:<filter> <filter-name>Sitemesh</filter-name> <filter-class> com.opensymphony.module.sitemesh.filter.PageFilter </filter-class> </filter> <filter-mapping> <filter-name>Sitemesh</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <filter> <filter-name>Acegi Filter Chain Proxy</filter-name> <filter-class> org.acegisecurity.util.FilterToBeanProxy </filter-class> <init-param> <param-name>targetBean</param-name> <param-value>acegiFilterChainProxy</param-value> </init-param> </filter> <filter-mapping> <filter-name>Acegi Filter Chain Proxy</filter-name> <servlet-name>FacesServlet</servlet-name> <dispatcher>FORWARD</dispatcher> <dispatcher>REQUEST</dispatcher> </filter-mapping>
The problem is when I try to access for e.g. /user/list.jsf it redirects to /login.jsf, wich renders smooth (no decorator). After I login, it redirects to /user/list.jsf page without decoration, and does not change the URL in the address bar.Code:<?xml version="1.0" encoding="ISO-8859-1"?> <decorators defaultdir="/WEB-INF/decorators"> <excludes> <pattern>/login.jsf</pattern> <pattern>/welcome.jsf</pattern> </excludes> <decorator name="main" page="main.jsp"> <pattern>/*</pattern> </decorator> </decorators>
Part of my faces-navigation.xml:
Is this a face-navigation.xml issue?Code:<navigation-rule> <from-view-id>*</from-view-id> <navigation-case> <from-outcome>login</from-outcome> <to-view-id>/login.jsp</to-view-id> </navigation-case> </navigation-rule> <navigation-rule> <from-view-id>/login.jsp</from-view-id> <navigation-case> <from-outcome>welcome</from-outcome> <to-view-id>/welcome.jsp</to-view-id> </navigation-case> <navigation-case> <from-outcome>error</from-outcome> <to-view-id>/login.jsp</to-view-id> </navigation-case> </navigation-rule> <navigation-rule> <from-view-id>/user/list.jsp</from-view-id> <navigation-case> <from-outcome>form</from-outcome> <to-view-id>/user/form.jsp</to-view-id> </navigation-case> <navigation-case> <from-outcome>view</from-outcome> <to-view-id>/user/view.jsp</to-view-id> </navigation-case> </navigation-rule>
How can I fix this?
Thanks!


