[opencms-dev] OpenCms Logout with Websphere (redirect problems)

Alejandro.Latorre.Miguel at everis.com Alejandro.Latorre.Miguel at everis.com
Fri Aug 29 12:45:02 CEST 2008


Hello everybody,

At first sorry about my English, I am going to improve it in a course this 
year. The question is the next: I am trying to run OpenCms in a Websphere 
Server  and after the corresponding configuration I have a problems with 
the redirection and the logout.  In Tomcat there aren`t problems but in 
WebSphere the redirect after the OpenCms demo logout doesn't work. I read 
in other forums some answers  refering about the WebSphere  problems with 
redirection, and I change in the CmsWorkplace class  the redirect of the 
method sendCmsRedirect to a Forward like this:

 public void sendCmsRedirect(String location) throws IOException, 
ServletException {

        // TOOD: IBM Websphere v5 has problems here, use forward instead 
(which has other problems)
          // This is the old code before my changes...
        // 
getJsp().getResponse().sendRedirect(OpenCms.getSystemInfo().getOpenCmsContext() 
+ location);
 
      setForwarded(true);
 
      CmsUriSplitter splitter = new CmsUriSplitter(OpenCms.getSystemInfo
().getOpenCmsContext() + location);
      Map params = CmsRequestUtil.createParameterMap(splitter.getQuery());
      sendForward(splitter.getPrefix(), params);
 
 
 }

 public void sendForward(String location, Map params) throws IOException, 
ServletException {

        setForwarded(true);
        // params must be arrays of String, ensure this is the case
        params = CmsRequestUtil.createParameterMap(params);
        CmsRequestUtil.forwardRequest(getJsp().link(location), params, 
getJsp().getRequest(), getJsp().getResponse());
    }


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

And in CmsJspLoginBean class I change the method logout and put the next 
code (similar to login...):



public void login(String userName, String password, String projectName, 
String redirectUri) throws IOException {

        login(userName, password, projectName);
        if (m_loginException == null) {
            if (redirectUri != null) {
                getResponse().sendRedirect(
                    OpenCms.getLinkManager
().substituteLink(getCmsObject(), redirectUri, null, true));
            } else {
                getResponse().sendRedirect(getFormLink());
            }
        }
    }

 public void logout(String redirectUri) throws IOException {

     HttpSession session = getRequest().getSession(false);
     if (session != null) {
          session.invalidate();
     }
     // logout was successful
     if (LOG.isInfoEnabled()) {
        LOG.info(Messages.get().getBundle().key(
            Messages.LOG_LOGOUT_SUCCESFUL_3,
            getRequestContext().currentUser().getName(),
            getRequestContext().addSiteRoot(getRequestContext().getUri()),
            getRequestContext().getRemoteAddress()));
        }
 
      if (redirectUri != null) {
          getResponse().sendRedirect(
                OpenCms.getLinkManager().substituteLink(getCmsObject(), 
redirectUri, null, true));
      } else {
            getResponse().sendRedirect(getFormLink());
      }
 
 }


After the changes, the problem still apear. The parameter 
?path=/demo_en/extra/login.jsp after the logout in the url appear but the 
redirection doesn't work. I don't know what many things can I do.

Thanks you in advance for any help you can give,

ALEJANDRO
email: Alejandro.Latorre.Miguel at everis.com




 

AVISO DE CONFIDENCIALIDAD.
Este correo y la información contenida o adjunta al mismo es privada y 
confidencial y va dirigida exclusivamente a su destinatario. everis 
informa a quien pueda haber recibido este correo por error que contiene 
información confidencial cuyo uso, copia, reproducción o distribución está 
expresamente prohibida. Si no es Vd. el destinatario del mismo y recibe 
este correo por error, le rogamos lo ponga en conocimiento del emisor y 
proceda a su eliminación sin copiarlo, imprimirlo o utilizarlo de ningún 
modo.

CONFIDENTIALITY WARNING.This message and the information contained in or 
attached to it are private and confidential and intended exclusively for 
the addressee. everis informs to whom it may receive it in error that it 
contains privileged information and its use, copy, reproduction or 
distribution is prohibited. If you are not an intended recipient of this 
E-mail, please notify the sender, delete it and do not read, act upon, 
print, disclose, copy, retain or redistribute any portion of this E-mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20080829/3b07f936/attachment.htm>


More information about the opencms-dev mailing list