cancel
Showing results for 
Search instead for 
Did you mean: 

Default faces navigation (redirect?)

shmoula
Champ in-the-making
Champ in-the-making
Hi guys, I'm almost going crazy with this:
  Where I can find rule, which defines, where to go, when I'm not logged in? I mean these situations:
* You open localhost/alfresco and you are redirected to localhost/alfresco/faces/jsp/login.jsp
* You open localhost/alfresco/faces/jsp/something.jsp and you are redirected to localhost/alfresco/faces/jsp/login.jsp
* I want my own localhost/alfresco/faces/jsp/something.jsp page in there and I need to access that!

So there must be some default redirect, but where? I found some information on faces, searched through alfresco src for login.jsp (I'm expecting that this is defined inside web config as login page and accesed via clientConfig.getLoginPage()), but there is nothing :-(. Any ideas, please?
12 REPLIES 12

shmoula
Champ in-the-making
Champ in-the-making
Oh, i think i got it: there is defined what to do in org.alfresco.web.app.Application.java - getLoginPage. Is there any way how to "bridge" this? Solution like my own login.jsp with big switch doesn't sound good for me 😞

lover91
Champ in-the-making
Champ in-the-making
how can I do it ?

redirect to page without login

jayjayecl
Confirmed Champ
Confirmed Champ
Have a look at navigation-rules in faces-config-navigation.xml in WEB-INF/
Then, check the rules about login and logout, and override them in faces-config-custom.xml

Hope this helps

shmoula
Champ in-the-making
Champ in-the-making
Thanks for response JayJayECL, but don't worry, I already tried this - it was my first step 🙂

jayjayecl
Confirmed Champ
Confirmed Champ
No offense, but you should have missed something because it's the way I got it worked

shmoula
Champ in-the-making
Champ in-the-making
Not in my case :-(. That * are there just for testing ;-).

<navigation-rule>
      <from-view-id>/jsp/login.jsp</from-view-id>
      <navigation-case>
         <from-outcome>registerUser</from-outcome>
         <to-view-id>/jsp/register.jsp</to-view-id>
      </navigation-case>
   </navigation-rule>
   
   <navigation-rule>
      <from-view-id>/jsp/*</from-view-id>
      <navigation-case>
         <from-outcome>cancelRegister</from-outcome>
         <to-view-id>/jsp/login.jsp</to-view-id>
      </navigation-case>
   </navigation-rule>
   
   <navigation-rule>
      <from-view-id>/jsp/*</from-view-id>
      <navigation-case>
         <from-outcome>doRegister</from-outcome>
         <to-view-id>/jsp/login.jsp</to-view-id>
      </navigation-case>
   </navigation-rule>

jayjayecl
Confirmed Champ
Confirmed Champ
could you provide us with the whole content of this file ?
By the way, which file is it / where is it located etc … ?

shmoula
Champ in-the-making
Champ in-the-making
It's my 'faces-config-ext.xml', in which are defined my components and other navigation rules, which works (after login of course). Those rules I want to implement I want to work without login. But there is some 'FORCE navigation' directly in Alfresco code (I can't remember for that filename right now).

jayjayecl
Confirmed Champ
Confirmed Champ
See the content of my faces-config-custom.xml :


<faces-config>

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

</faces-config>

I can tell you that I now have a custom login page, that I'll find in jsp/extension/login.jsp


Maybe your faces-config-ext.xml is loaded before faces-config-navigation.xml, that's why your custom rules are taken into account, but your overriding rules are not because they are loaded before basic navigation rules.
Try to put the overriding rules into faces-config-custom.xml