You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Piyush Asthana <pi...@patni.com> on 2001/12/05 07:24:36 UTC

Problems of Integrating Cactus 1.2 into VisualAge4.0

Hi All

I am trying to integrate Cactus v1.2 into Visual Age for Java 4.0.
The Cactus pakage "org.apache.cactus.client" has a class called
"HttpClientHelper" which has the following method in it.

<---------------------------------
private String getPath(WebRequest theRequest, URLConnection theConnection)
    {
        logger.entry("getPath(...)");

        String path;
        ServletURL url = theRequest.getURL();

        if ((url != null) && (url.getPath() != null)) {
            path = url.getPath();
        } else {
            path = theConnection.getURL().getPath();
        }

        logger.debug("Cookie validation pah = [" + path + "]");

        logger.exit("getPath");
        return path;
    }
<-------------------------------------

In this method, in the line "path = theConnection.getURL().getPath();" the
URL Class of java.net.io is using the getPath method which is present only
in jdk1.3 onwards.

Since Visual Age for Java uses jdk1.2.2, this method is not defined for the
java.net.URL class of jdk1.2.2

Could anybody please suggest a workaround or solution for this.

Thanks
Piyush A.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Problems of Integrating Cactus 1.2 into VisualAge4.0

Posted by Vincent Massol <vm...@octo.com>.
Thanks Piyush,

I have modified the line to be :

            String file = theConnection.getURL().getFile();
            if (file != null) {
                int q = file.lastIndexOf('?');
                if (q != -1) {
                    path = file.substring(0, q);
                } else {
                    path = file;
                }
            } else {
                path = null;
            }

instead of

path = theConnection.getURL().getPath();

The modification is done in Cactus 1.3dev in CVS.

-Vincent

P.S. : I don't have the JDK 1.2.2 any more on my machine. Could you confirm
that getFile() and getPath()

----- Original Message -----
From: "Piyush Asthana" <pi...@patni.com>
To: <ca...@jakarta.apache.org>
Sent: Wednesday, December 05, 2001 6:24 AM
Subject: Problems of Integrating Cactus 1.2 into VisualAge4.0


> Hi All
>
> I am trying to integrate Cactus v1.2 into Visual Age for Java 4.0.
> The Cactus pakage "org.apache.cactus.client" has a class called
> "HttpClientHelper" which has the following method in it.
>
> <---------------------------------
> private String getPath(WebRequest theRequest, URLConnection theConnection)
>     {
>         logger.entry("getPath(...)");
>
>         String path;
>         ServletURL url = theRequest.getURL();
>
>         if ((url != null) && (url.getPath() != null)) {
>             path = url.getPath();
>         } else {
>             path = theConnection.getURL().getPath();
>         }
>
>         logger.debug("Cookie validation pah = [" + path + "]");
>
>         logger.exit("getPath");
>         return path;
>     }
> <-------------------------------------
>
> In this method, in the line "path = theConnection.getURL().getPath();" the
> URL Class of java.net.io is using the getPath method which is present only
> in jdk1.3 onwards.
>
> Since Visual Age for Java uses jdk1.2.2, this method is not defined for
the
> java.net.URL class of jdk1.2.2
>
> Could anybody please suggest a workaround or solution for this.
>
> Thanks
> Piyush A.
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>