Minor aesthetic point, but this code will
always append a "?" to every GET request...
whether there is a query string or not.

Another thing to consider, which is afaik
a legal construct...

<form action="/servlet/someservlet?arg=value" method="POST">
[input fields]
</form>

which will result in both a query string, and 
post arguments.

Granted, many CGI implementations don't deal 
with this correctly, but I've found most browsers
do.


P)

[EMAIL PROTECTED] wrote:
>   -             if(!getPath().startsWith("/"))
>   +             String pathAndQuery = null;
>   +             if(this.getMethod().equals(this.GET))
>                 {
>   -                     setPath("/"+getPath());
>   +                     pathAndQuery = this.getPath()+"?"+getQueryString();
>                 }
>   +             else
>   +             {
>   +                     pathAndQuery = this.getPath();
>   +             }
>   +             if(!pathAndQuery.startsWith("/"))
>   +             {
>   +                     pathAndQuery = "/" + pathAndQuery;
>   +             }
>                 if(getPort() == 0)
>                 {
>   -                     return new URL(getProtocol(),getDomain(),getPath());
>   +                     return new URL(getProtocol(),getDomain(),pathAndQuery);
>                 }
>                 else
>                 {
>   -                     return new URL(getProtocol(), 
>(String)properties.get(DOMAIN), getPort(), (String)properties.get(PATH));
>   +                     return new URL(getProtocol(), 
>(String)properties.get(DOMAIN), getPort(),
>   +                                               pathAndQuery);
>                 }

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to