cancel
Showing results for 
Search instead for 
Did you mean: 

Logout Process

riagarwal
Champ in-the-making
Champ in-the-making
Hi,

I would like to have the feature where when i logout from any user.. it should go to the guest user login instead of Login Page.. and when i click on logout from the guest user.. then it should go for Login Page..

Please assist.

Thanks
5 REPLIES 5

tfaudot
Champ in-the-making
Champ in-the-making
same wish here…

I tried messing up with the faces-config-navigation.xml on the logout action but without success…

Please tell me if you succeed in any way, thanks!

zaizi
Champ in-the-making
Champ in-the-making
To have the user redirected to the dashboard as the guest user open "tomcat/webapps/alfresco/WEB-INF/faces-config-navigation.xml' and modify the following snippet. Assuming you haven't disabled guest log in it should redirect the user to the dashboard when logging out. This should log in the user as guest as default. Better option is to use the Custom Login sample and modify and package the faces config.

   <navigation-rule>
      <from-view-id>/jsp/*</from-view-id>
      <navigation-case>
         <from-outcome>logout</from-outcome>
         <to-view-id>/jsp/login.jsp</to-view-id>
      </navigation-case>
      <navigation-case>
         <from-outcome>relogin</from-outcome>
         <to-view-id>/jsp/relogin.jsp</to-view-id>
      </navigation-case>
   </navigation-rule>

with

   <navigation-rule>
      <from-view-id>/jsp/*</from-view-id>
      <navigation-case>
         <from-outcome>logout</from-outcome>
         <to-view-id>/jsp/browse/dashboard.jsp</to-view-id>
      </navigation-case>
      <navigation-case>
         <from-outcome>relogin</from-outcome>
         <to-view-id>/jsp/relogin.jsp</to-view-id>
      </navigation-case>
   </navigation-rule>
.

tfaudot
Champ in-the-making
Champ in-the-making
That's what I tried in my previous attempts, but eveytime I change the outcome of the logout action I get an exception :
javax.faces.FacesException: Cannot get value for expression '#{NavigationBean.toolbarLocation}'
caused by:
org.apache.jasper.JasperException: Cannot get value for expression '#{NavigationBean.toolbarLocation}'
caused by:
javax.faces.el.EvaluationException: Cannot get value for expression '#{NavigationBean.toolbarLocation}'
caused by:
javax.faces.el.EvaluationException: Exception getting value of property toolbarLocation of base of type : org.alfresco.web.bean.NavigationBean
caused by:
javax.faces.el.EvaluationException: Bean: org.alfresco.web.bean.NavigationBean, property: toolbarLocation
caused by:
java.lang.reflect.InvocationTargetException
caused by:
java.lang.NullPointerException

mask details

javax.faces.FacesException: Cannot get value for expression '#{NavigationBean.toolbarLocation}'
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:425)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:211)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.apache.jasper.JasperException: Cannot get value for expression '#{NavigationBean.toolbarLocation}'
at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:476)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:419)
… 21 more

😞

zaizi
Champ in-the-making
Champ in-the-making
My mistake. Try redirecting logout to index.jsp.

<to-view-id>index.jsp</to-view-id>

It sets up the authentication / session as guest user and does the redirect.

riagarwal
Champ in-the-making
Champ in-the-making
Hi,

I did the following changes in teh Faces.config.navigation file..

  <navigation-rule>
      <from-view-id>/jsp/*</from-view-id>
      <navigation-case>
         <from-outcome>logout</from-outcome>
         <to-view-id>/jsp/browse/dashboard.jsp</to-view-id>
      </navigation-case>
      <navigation-case>
         <from-outcome>relogin</from-outcome>
         <to-view-id>index.jsp</to-view-id>
      </navigation-case>
   </navigation-rule>


However, I am still getting the java Exception.. Please suggest as to what is wrong in the code…