Spaces in url parameters

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Spaces in url parameters

Fiona Murphy
Hi all,

I am new to ops and have started developing an experimental application for my organisation. I have found this forum to be very helpful with some of the issues I've come across, so hopefully someone can help me with this.

What I want to know is, is there a way to have url parameters that include a space? At the moment when I try this I am getting this exception: java.net.URISyntaxException: Illegal character in query at index 35: /strategy/detail?jelr-area=Tackling Crime.

Thanks,
Fiona
Reply | Threaded
Open this post in threaded view
|

Re: Spaces in url parameters

Joseph Lawrence
Fiona,
   Why not you try the encode-for-uri() function.
 
Alternatively, you can use the get method for submission and reference the parameter instance to the @ref attribute of the submission.
 
1st method:
 
<xforms:instance id="main">
     <main>
           <jelr-area>Tackling Crime</jelr-area>
     </main>
</xforms:instance>
 
and in the body,
 
<xforms:trigger>
     <xforms:label>Submit</xforms:label>
     <xforms:load resource="/strategy/detail?jelr-area={{encode-for-uri(instance('main')/jelr-area)}}" ev:event="DOMActivate"/>
</xforms:trigger>
          
2nd Method:
    
  
<xforms:instance id="main">
     <main>
           <jelr-area>Tackling Crime</jelr-area>
     </main>
</xforms:instance>
 
<xforms:submission id="main-submission" action="/strategy/detail" method="get" ref="instance('main')" replace="all"/>
 
Joseph Lawrence
Stabilix Solutions

Fiona Murphy <[hidden email]> wrote:

Hi all,

I am new to ops and have started developing an experimental application for
my organisation. I have found this forum to be very helpful with some of the
issues I've come across, so hopefully someone can help me with this.

What I want to know is, is there a way to have url parameters that include a
space? At the moment when I try this I am getting this exception:
java.net.URISyntaxException: Illegal character in query at index 35:
/strategy/detail?jelr-area=Tackling Crime.

Thanks,
Fiona

--
View this message in context: http://www.nabble.com/Spaces-in-url-parameters-tf3173499.html#a8803876
Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws


Never miss an email again!
Yahoo! Toolbar
alerts you the instant new Mail arrives. Check it out.

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Spaces in url parameters

Erik Bruchez
Administrator
In reply to this post by Fiona Murphy
Fiona,

Not all characters are literally allowed in URLs. In particular, spaces
are not allowed. You must instead use "+" or "%20", so your URL would
become:

   /strategy/detail?jelr-area=Tackling+Crime

or:

   /strategy/detail?jelr-area=Tackling%20Crime

Both URLs are equivalent.

-Erik

Fiona Murphy wrote:

> Hi all,
>
> I am new to ops and have started developing an experimental application for
> my organisation. I have found this forum to be very helpful with some of the
> issues I've come across, so hopefully someone can help me with this.
>
> What I want to know is, is there a way to have url parameters that include a
> space? At the moment when I try this I am getting this exception:
> java.net.URISyntaxException: Illegal character in query at index 35:
> /strategy/detail?jelr-area=Tackling Crime.
>
> Thanks,
> Fiona
--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws