[Dspace-general] redirection to 'community-list.jsp'

Stuart Lewis sdl at aber.ac.uk
Mon Dec 22 16:02:43 EST 2008


Hi Anna,

> i'm working with 1.5.1 version -with the jspui- and i'm dealing with the
> following problem:
>  i have been trying to get the redirection in the jspui from the
> 'ldap-form.jsp' (where the ldap authorization is acquired) not to the
> '/mydspace' page but to '/community-list.jsp' page.
> i've looked through the JSPs and java files which are relative to
> ldap&authorization for a link like '/mydspace' but didn't find anything execpt
> one in the 'authenticate.java'file but this is not for this specific
> redirection. Has anyone found it?

This is issue is slightly complicated. The URL that the user is redirected
to is in Authenticate.java (line 145) as you have found:

 - originalURL = request.getContextPath() + "/mydspace";

However... this is only used if a user requested the login screen, rather
than DSpace redirecting them there, in which case DSpace decides where to
forward them to. For example if a user tries to access a restricted item,
and they are not logged in, then they will be redirected to the login
screen. Once they have logged in, DSpace will then forward them to the item
they requested.

If you want to log in directly, then visit
http://your-dspace/jspui/ldap-login and if you have changed the line in
Authenticate.java then they should be redirected appropriately.

If this is not happening, it is probably because your users are clicking on
'My DSpace' in order to log in. This tries to take them to their 'My DSpace'
screen, but first requires them to log in. Once they have done so, they are
redirected to the page they wanted, My DSpace. DSpace is sending them to the
destination that they requested.

If you want all users to be redirected to a different URL all of the time,
then change the following code in Authenticate.java:

 if (originalURL == null)
 {
     // If for some reason we don't have the original URL, redirect
     // to My DSpace
     originalURL = request.getContextPath() + "/mydspace";
  }
  else
  {
     // Set the flag in the session, so that when the redirect is
     // followed, we'll know to resume the interrupted request
     session.setAttribute("resuming.request", new Boolean(true));
  }

Change this to just:

  originalURL = request.getContextPath() + "/community-list";

I hope this helps,


Stuart
_________________________________________________________________

Gwasanaethau Gwybodaeth                      Information Services
Prifysgol Aberystwyth                      Aberystwyth University

            E-bost / E-mail: Stuart.Lewis at aber.ac.uk
                 Ffon / Tel: (01970) 622860
_________________________________________________________________




More information about the Dspace-general mailing list