Extract http:// from url

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

Extract http:// from url

Dromela
Hello,

I have a problem. I want to extract a url from another url in the pagle-flow. For example, I have this :

 <page id="detail" path-info="/server/(.*)/([^/]+)/separate/(.*)/([^/]+)/([^/]+)" matcher="oxf:perl5-matcher"
                        default-submission="parameters_preview.xml"
                       
                        view = "model-action.xpl">
                       
                        <setvalue ref="/parameters/initialdata-id" matcher-group="1"/>
                        <setvalue ref="/parameters/typeinitialdata-id" matcher-group="2"/>
          <setvalue ref="/parameters/urlreturn-id" matcher-group="3"/>
          <setvalue ref="/parameters/form-id" matcher-group="5"/>
        <setvalue ref="/parameters/type-id" matcher-group="4"/>
        <setvalue ref="/parameters/readonly" parameter="readonly"/>

The matcher-group="3" is for example : http://www.google.com , but the matcher give me this => http:/www.google.com   .... the "//" goes to "/" ... and I need the orginal "//".

Any idea?? Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Extract http:// from url

Hank Ratzesberger
Hi,

So, after the "/separate/" there is the protocol:domain part of a url
and "/....."

A wild guess...

(https?://[\w\d.-]+?)

for your #3 match.  You may need to add other character options
to the [class] .

HTH,
Hank



On Apr 2, 2008, at 1:12 AM, Dromela wrote:

>
> Hello,
>
> I have a problem. I want to extract a url from another url in the
> pagle-flow. For example, I have this :
>
>  <page id="detail"
> path-info="/server/(.*)/([^/]+)/separate/(.*)/([^/]+)/([^/]+)"
> matcher="oxf:perl5-matcher"
> default-submission="parameters_preview.xml"
>
> view = "model-action.xpl">
>
> <setvalue ref="/parameters/initialdata-id" matcher-group="1"/>
> <setvalue ref="/parameters/typeinitialdata-id" matcher-group="2"/>
>           <setvalue ref="/parameters/urlreturn-id" matcher-group="3"/>
>           <setvalue ref="/parameters/form-id" matcher-group="5"/>
>         <setvalue ref="/parameters/type-id" matcher-group="4"/>
>         <setvalue ref="/parameters/readonly" parameter="readonly"/>
>
> The matcher-group="3" is for example : http://www.google.com , but the
> matcher give me this => http:/www.google.com   .... the "//" goes  
> to "/" ...
> and I need the orginal "//".
>
> Any idea?? Thanks
> --
> View this message in context: <a href="http://www.nabble.com/Extract-http%">http://www.nabble.com/Extract-http% 
> 3A---from-url-tp16444486p16444486.html
> 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
> OW2 mailing lists service home page: http://www.ow2.org/wws
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
Reply | Threaded
Open this post in threaded view
|

Re: Extract http:// from url

Alessandro Vernet
Administrator
In reply to this post by Dromela
On Wed, Apr 2, 2008 at 1:12 AM, Dromela <[hidden email]> wrote:
>  The matcher-group="3" is for example : http://www.google.com , but the
>  matcher give me this => http:/www.google.com   .... the "//" goes to "/" ...
>  and I need the orginal "//".

I wouldn't be surprised if "//" (multiple slash) in the path part of
the URL were replaced by "/" (single slash). This may be done before
we get the URL (by the servlet engine, Apache, or even the browser). A
way to get around this, would be to pass the server URL (e.g.
http://www.google.com ) not inside the URL, but as a request parameter
(e.g. ...?server=http://www.google.com).

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.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
OW2 mailing lists service home page: http://www.ow2.org/wws