cancel
Showing results for 
Search instead for 
Did you mean: 

Overriding the login page

tvaughan77
Champ in-the-making
Champ in-the-making
Hi,

I just bought Jeff Potts' "Alfresco Developer Guide" and I'm trying to get one of his first examples to work correctly…maybe someone here can point out what I'm doing wrong?

I'm trying to replace the default login.jsp with a custom login.jsp page (with just a change to the logo, for starters)

I added a /web/META-INF/faces-config.xml with this snippet:

   <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>

And added a slightly changed /web/jsp/extension/login.jsp with a different logo

I overwrote the alfresco.war's exploded $TOMCAT_HOME/webapps/alfresco content with those two files and started the application back up.

When I log in to the application, I am first presented with the original login.jsp, which I log in to with admin/admin.  Then I'm presented with my extension/login.jsp which I login to again with admin/admin, and only after the 2nd login am I passed through to the browse.jsp.

What else needs to be done to avoid the "double login" scenario?  Should I delete the original login.jsp page?  I'm hoping I can leave the default alfresco structure alone and just drop customizations "around" the original structure…

Here's what my exploded war looks like right now:

./jsp
      /login.jsp
      /extension
               /login.jsp
./META-INF
      /faces-config.xml

TIA,
Tom
2 REPLIES 2

jpotts
World-Class Innovator
World-Class Innovator
Tom,

The faces-config.xml file goes in the META-INF of your JAR file, not the Alfresco WAR. That's because you are overriding a navigation rule.

So your web app directory should contain your JSP's, as you've listed, and then your WEB-INF/lib directory should contain a JAR called someco-client-extensions.jar and in that JAR, there should be a faces-config.xml file in META-INF.

It also looks like you are missing a couple more navigation rules, but they are related to the "logout" and "relogin" navigation cases so they aren't causing this particular problem.

The last thing to check is the "login-page" setting in the web-client-config-custom.xml file. It should point to your extended login page, like this:

<config>
  <client>
    <login-page>/jsp/extension/login.jsp</login-page>
    …snip…
  </client>
</config>

Hope that helps,

Jeff

tvaughan77
Champ in-the-making
Champ in-the-making
Ohhhhh…..yeah, right there at the bottom of page #38 you say that.  Duh. Smiley Surprisedops:

So, generally speaking, JSPs and content (images, etc) actually get dumped over top of the war (in an .xxx/extensions directory, hopefully) and everything else gets bundled up in the JAR?