You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Bhadra, Jatin" <ja...@landg.com> on 2001/09/05 17:48:06 UTC
spaces in url for get task (2)
Hi all,
I want to pass the following URL as the source parameter to the get task.
http://localhost:32000/servlet/vajimport?rep=c:/ant-1.3/New repository.dat
What this URL does is calls a servlet vajimport that runs in Visual Age for
Java
(VAJ) servlet engine. Parameter rep takes in the path of repository to be
imported.
I have this following task in my build.xml file
<get src="http://localhost:32000/servlet/vajimport?rep=New repository.dat"
dest="c:/test.html"/>
I can see the message
[get] Getting: "http://localhost:32000/servlet/vajimport?rep=c:/ant-1.3/New
repository.dat"
But the request that is sent to the server is only
http://localhost:32000/servlet/vajimport?rep=c:/ant-1.3/New
I would had assumed that in ant all the spaces will be replaced by + or %20
.
Has any one come across this problem before.
Thanks in advance
Jatin
PS: I known that I can replace the space in my request with + or %20 but
since the parameter
that I pass in is a variable I have no control over it.
=======================================================================
This e-mail (and any attachments) may contain privileged and/or
confidential information. If you are not the intended recipient
please do not disclose, copy, distribute, disseminate or take any
action in reliance on it. If you have received this message in
error please reply and tell us and then delete it.
Any information contained in this message may be subject to
applicable terms and conditions and must not be construed as
giving investment advice within or outside the United Kingdom.
Should you wish to communicate with us by e-mail we cannot guarantee
the security of any data outside our own computer systems.
=======================================================================
Re: spaces in url for get task (2)
Posted by Benjamin Reed <ra...@befunk.com>.
Bhadra, Jatin [jatin.harish@landg.com] wrote:
> I would had assumed that in ant all the spaces will be replaced
> by + or %20.
>
> Has any one come across this problem before.
>
> Thanks in advance
> Jatin
>
> PS: I known that I can replace the space in my request with +
> or %20 but since the parameter that I pass in is a variable I
> have no control over it.
According to the RFC (1738), spaces in URLs are supposed to be
ignored completely; if a space needs to be passed in a URL it
should always be encoded:
Characters can be unsafe for a number of reasons. The space
character is unsafe because significant spaces may disappear
and insignificant spaces may be introduced when URLs are
transcribed or typeset or subjected to the treatment of
word-processing programs.
...
In some cases, extra whitespace (spaces, linebreaks, tabs,
etc.) may need to be added to break long URLs across lines.
The whitespace should be ignored when extracting the URL.
Is there no way to fix the non-conforming app that's passing
spaces in URLs?
--
Ben Reed a.k.a. Ranger Rick (ranger@befunk.com)
http://defiance.dyndns.org/ / http://radio.scenespot.org/
The devil's in the broad, sweeping generalizations.