Login  Register

Re: Invalid URL on otherwise valid eXist queries

Posted by Alessandro Vernet on Jan 09, 2010; 3:39am
URL: https://discuss.orbeon.com/Invalid-URL-on-otherwise-valid-eXist-queries-tp1008531p1010152.html

Hank,

I am wondering if you get this exception HttpClient exception because  
it wants more characters (such as the brackets) to be encoded. I use  
the _query =... trick a lot, and often use it with encode-for-uri().  
E.g.:

<xforms:submission method="get" action="...?_query={encode-for-uri
(...)}"/>

You can't use an AVT in <xforms:instance src="...">, but you can run a  
submission on xforms-model-construct-done and put the oxfords:readonly  
on that submission.

Alex



On Jan 6, 2010, at 4:45 PM, Hank Ratzesberger  
<[hidden email]> wrote:

> I could simplify parts of my application, hopefully improve  
> performance a bit if I
> could use the same URL's as an instance src attribute as I do on a  
> browser address.
>
> For example, enter the following in the browser and I get the
>
> http://db.nees.ucsb.edu/exist/rest?_query=doc('/pub/sitechan.xml')//sitechan[sta='GVDA'][matches(chan,'^H')]
>
> and I get the particular subset I need.  The browser translates the  
> url to this:
>
> http://db.nees.ucsb.edu/exist/rest?_query=doc%28%27/pub/sitechan.xml%27%29//sitechan[sta=%27GVDA%27][matches%28chan,%27^H%27%29]
>
> However, the same url, translated or not, cannot be used as an  
> instance src attribute:
>
> <xforms:instance id="gvda-sitechans"
>  src="http://db.nees.ucsb.edu/exist/rest?_query=doc%28%27/pub/sitechan.xml%27%29//sitechan[sta=%27GVDA%27][matches%28chan,%27i^H%27%29]
> "
>   xxforms:readonly="true"/>
>
>
>
> java.lang.IllegalArgumentException Exception Class  
> java.lang.IllegalArgumentException Message Invalid uri 'http://db.nees.ucsb.edu/exist/rest?_query=doc('/pub/sitechan.xml')//sitechan[sta='GVDA']':
>  Invalid query Servlet Stack Trace
> (119 method calls)
> Class Name    Method Name    File Name    Line Number
> org.apache.commons.httpclient.HttpMethodBase    <init>    
> HttpMethodBase.java    222
> org.apache.commons.httpclient.methods.GetMethod    <init>    
> GetMethod.java    89
> org.orbeon.oxf.resources.handler.HTTPURLConnection    
> setRequestMethod    HTTPURLConnection.java    78
>
> Is there a way to avoid url checking? Looks like it's part of the  
> apache commons, but
> it seems to me this behavior is recent, within the last year.
>
> Thanks,
> Hank
>
>
>
> Hank Ratzesberger
> NEES@UCSB
> Institute for Crustal Studies,
> University of California, Santa Barbara
> 805-893-8042
>
>
>
>
>
>
> --
> 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
> OW2 mailing lists service home page: http://www.ow2.org/wws


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet