You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Perez Carmona, David" <DP...@fcc.es> on 2004/06/01 13:01:42 UTC

Hi all,

I have a web application whose content is root.
Also I have a matcher at the beginning of the pipeline that handles the entry point

<map:match pattern="">
    <map:act src="my-action">
        ....
    </map:act>
</map:match>

The problem is that I never enter inside the matcher (i.e. my-action is never called) when I browse to http://localhost or http://localhost/.
The response I get under IE6 is:
    Cannot find server or DNS error.

After having debugged a little inside CocoonServlet.java, I discover that the code is trying to redirect to http://localhost//

This snippet in CocoonServlet.service() is the responsible:

    String uri = request.getServletPath();	// uri.equals("") in my case
    if (uri == null) {
        uri = "";
    }
    String pathInfo = request.getPathInfo(); // pathInfo == null in my case
    if (uri.length() == 0) {	// uri == '' here
         String prefix = request.getRequestURI();
         if (prefix == null) {
            prefix = "";
         }

         res.sendRedirect(res.encodeRedirectURL(prefix + "/"));	// res.sendRedirect("//") in my case
         return;
    }

Why is the slash doubled?
It is strange because I have never had problems with this, it used to work before.
Is this a known Cocoon bug?


I'm working with Tomcat 4.1.18, Java 1.4.2_04, Windows 2003 Server, Cocoon 2.1.2

*************************************************************
Este correo ha sido procesado por el Antivirus del Grupo FCC
*************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re:

Posted by Jan Hoskens <jh...@schaubroeck.be>.
You should mention your port with your host (host:portnumber), something
like

http://localhost:8080/

should do the trick, if not, your port will be different, so look it up in
the configuration of your server (tomcat/jetty...)
Then make sure you're pointing to the correct webapp, under tomcat every
webapp has its directory and it's name is used
to access each webapp, so then you'll end up with:

http://localhost:8080/cocoon/
(if cocoon is your webapp name)

You may configure your server to default to your cocoon and omit the
"cocoon/" part.

Kind Regards,
Jan

----- Original Message ----- 
From: "Perez Carmona, David" <DP...@fcc.es>
To: "Cocoon (E-mail)" <us...@cocoon.apache.org>
Sent: Tuesday, June 01, 2004 1:01 PM
Subject: <match patern=""/>


>
> Hi all,
>
> I have a web application whose content is root.
> Also I have a matcher at the beginning of the pipeline that handles the
entry point
>
> <map:match pattern="">
>     <map:act src="my-action">
>         ....
>     </map:act>
> </map:match>
>
> The problem is that I never enter inside the matcher (i.e. my-action is
never called) when I browse to http://localhost or http://localhost/.
> The response I get under IE6 is:
>     Cannot find server or DNS error.
>
> After having debugged a little inside CocoonServlet.java, I discover that
the code is trying to redirect to http://localhost//
>
> This snippet in CocoonServlet.service() is the responsible:
>
>     String uri = request.getServletPath(); // uri.equals("") in my case
>     if (uri == null) {
>         uri = "";
>     }
>     String pathInfo = request.getPathInfo(); // pathInfo == null in my
case
>     if (uri.length() == 0) { // uri == '' here
>          String prefix = request.getRequestURI();
>          if (prefix == null) {
>             prefix = "";
>          }
>
>          res.sendRedirect(res.encodeRedirectURL(prefix + "/")); //
res.sendRedirect("//") in my case
>          return;
>     }
>
> Why is the slash doubled?
> It is strange because I have never had problems with this, it used to work
before.
> Is this a known Cocoon bug?
>
>
> I'm working with Tomcat 4.1.18, Java 1.4.2_04, Windows 2003 Server, Cocoon
2.1.2
>
> *************************************************************
> Este correo ha sido procesado por el Antivirus del Grupo FCC
> *************************************************************
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org