Xinclude and absolute paths

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

Xinclude and absolute paths

Alex Brown-5
Dear all,

I have a JSP (in /xforms-jsp/) whose output I wish to access at various
points in an application.

To include the content in a web page I can

        <xi:include
href='http://localhost:8080/myapp/xforms-jsp/my.jsp'/>

With no problem, but if I use an absolute path (which I want to do, so
as not to have to hard-code host, port, etc.)

        <xi:include href='/xforms-jsp/my.jsp'/>

Then OPS cannot load the resource, though

        <a href='/xforms-jsp/my.jsp'>click</a>

works fine (because URL re-writing prepends the context path to the URL
in this case?)

How can I get URL re-writing to work for XIncludes, or - better - how
can I know how the application interprets all absolute paths, with
confidence?

- Alex.



--
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: Xinclude and absolute paths

Alessandro  Vernet
Administrator
Alex,

If you want the URL to be re-written in this case, you have to modify
the Orbeon Forms Java code. And if you do, this is change that we'll
be interested in integrating in Orbeon Forms. Here are few pointers:

* filter.xpl is the pipeline that runs after your JSP runs.
* It executes the oxf:servlet-filter-generator processor which will
parse the data generated by the JSP.
* The interesting code that triggers does the parsing in Orbeon Forms
is in StreamInterceptor.parse().

I hope this helps,

Alex

On 12/11/06, Alex Brown <[hidden email]> wrote:

> Dear all,
>
> I have a JSP (in /xforms-jsp/) whose output I wish to access at various
> points in an application.
>
> To include the content in a web page I can
>
>         <xi:include
> href='http://localhost:8080/myapp/xforms-jsp/my.jsp'/>
>
> With no problem, but if I use an absolute path (which I want to do, so
> as not to have to hard-code host, port, etc.)
>
>         <xi:include href='/xforms-jsp/my.jsp'/>
>
> Then OPS cannot load the resource, though
>
>         <a href='/xforms-jsp/my.jsp'>click</a>
>
> works fine (because URL re-writing prepends the context path to the URL
> in this case?)
>
> How can I get URL re-writing to work for XIncludes, or - better - how
> can I know how the application interprets all absolute paths, with
> confidence?
>
> - Alex.
>
>
>
>
> --
> 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
>
>
>

--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

RE: Xinclude and absolute paths

Alex Brown-5
In reply to this post by Alex Brown-5
Alex hi

Thanks for your response. I'd be happy to modify the Java source if
necessary, BUT it's not a URL in the _result of_ the JSP I wish to
process, but the URL _of_ the JSP resource as used in the href attribute
of an XInclude directive.

i.e. I'd like

<xi:include href='/xforms-jsp/my.jsp'/>

Or

<xi:include href='/my-pipeline-produced-content'/>

To "just work".

I think I may be missing something fundamental - it seems I can't use
XInclude to include XPL results or JSP results withour hard-coding a
full absolute URL in the Xinclude's href, since these hrefs aren't
subject to URL rewriting. If only I knew the application context path, I
could synthesise an absolute URL with confidence -- is there a way to
determine the application context path (e.g.
"http://localhost:8080/myapp/" ?)

- Alex.

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf
> Of Alessandro Vernet
> Sent: 16 December 2006 01:32
> To: [hidden email]
> Subject: Re: [ops-users] Xinclude and absolute paths
>
> Alex,
>
> If you want the URL to be re-written in this case, you have
> to modify the Orbeon Forms Java code. And if you do, this is
> change that we'll be interested in integrating in Orbeon
> Forms. Here are few pointers:
>
> * filter.xpl is the pipeline that runs after your JSP runs.
> * It executes the oxf:servlet-filter-generator processor
> which will parse the data generated by the JSP.
> * The interesting code that triggers does the parsing in
> Orbeon Forms is in StreamInterceptor.parse().
>
> I hope this helps,
>
> Alex
>
> On 12/11/06, Alex Brown <[hidden email]> wrote:
> > Dear all,
> >
> > I have a JSP (in /xforms-jsp/) whose output I wish to access at
> > various points in an application.
> >
> > To include the content in a web page I can
> >
> >         <xi:include
> > href='http://localhost:8080/myapp/xforms-jsp/my.jsp'/>
> >
> > With no problem, but if I use an absolute path (which I
> want to do, so
> > as not to have to hard-code host, port, etc.)
> >
> >         <xi:include href='/xforms-jsp/my.jsp'/>
> >
> > Then OPS cannot load the resource, though
> >
> >         <a href='/xforms-jsp/my.jsp'>click</a>
> >
> > works fine (because URL re-writing prepends the context path to the
> > URL in this case?)
> >
> > How can I get URL re-writing to work for XIncludes, or -
> better - how
> > can I know how the application interprets all absolute paths, with
> > confidence?
> >
> > - Alex.
> >
> >
> >
> >
> > --
> > 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
> >
> >
> >
>
>
> --
> Blog (XML, Web apps, Open Source):
> http://www.orbeon.com/blog/
>
>


--
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: Xinclude and absolute paths

Alessandro  Vernet
Administrator
Hi Alex,

Just to make I understand your question, you would like to be able to write:

<xi:include href='/xforms-jsp/my.jsp'/>

But right now you have to write:

<xi:include href='/your-app/xforms-jsp/my.jsp'/>

Where "your-app" is the context of your application. Is that right?

Alex

On 12/18/06, Alex Brown <[hidden email]> wrote:

> Alex hi
>
> Thanks for your response. I'd be happy to modify the Java source if
> necessary, BUT it's not a URL in the _result of_ the JSP I wish to
> process, but the URL _of_ the JSP resource as used in the href attribute
> of an XInclude directive.
>
> i.e. I'd like
>
> <xi:include href='/xforms-jsp/my.jsp'/>
>
> Or
>
> <xi:include href='/my-pipeline-produced-content'/>
>
> To "just work".
>
> I think I may be missing something fundamental - it seems I can't use
> XInclude to include XPL results or JSP results withour hard-coding a
> full absolute URL in the Xinclude's href, since these hrefs aren't
> subject to URL rewriting. If only I knew the application context path, I
> could synthesise an absolute URL with confidence -- is there a way to
> determine the application context path (e.g.
> "http://localhost:8080/myapp/" ?)
>
> - Alex.
>
> > -----Original Message-----
> > From: [hidden email] [mailto:[hidden email]] On Behalf
> > Of Alessandro Vernet
> > Sent: 16 December 2006 01:32
> > To: [hidden email]
> > Subject: Re: [ops-users] Xinclude and absolute paths
> >
> > Alex,
> >
> > If you want the URL to be re-written in this case, you have
> > to modify the Orbeon Forms Java code. And if you do, this is
> > change that we'll be interested in integrating in Orbeon
> > Forms. Here are few pointers:
> >
> > * filter.xpl is the pipeline that runs after your JSP runs.
> > * It executes the oxf:servlet-filter-generator processor
> > which will parse the data generated by the JSP.
> > * The interesting code that triggers does the parsing in
> > Orbeon Forms is in StreamInterceptor.parse().
> >
> > I hope this helps,
> >
> > Alex
> >
> > On 12/11/06, Alex Brown <[hidden email]> wrote:
> > > Dear all,
> > >
> > > I have a JSP (in /xforms-jsp/) whose output I wish to access at
> > > various points in an application.
> > >
> > > To include the content in a web page I can
> > >
> > >         <xi:include
> > > href='http://localhost:8080/myapp/xforms-jsp/my.jsp'/>
> > >
> > > With no problem, but if I use an absolute path (which I
> > want to do, so
> > > as not to have to hard-code host, port, etc.)
> > >
> > >         <xi:include href='/xforms-jsp/my.jsp'/>
> > >
> > > Then OPS cannot load the resource, though
> > >
> > >         <a href='/xforms-jsp/my.jsp'>click</a>
> > >
> > > works fine (because URL re-writing prepends the context path to the
> > > URL in this case?)
> > >
> > > How can I get URL re-writing to work for XIncludes, or -
> > better - how
> > > can I know how the application interprets all absolute paths, with
> > > confidence?
> > >
> > > - Alex.
> > >
> > >
> > >
> > >
> > > --
> > > 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
> > >
> > >
> > >
> >
> >
> > --
> > Blog (XML, Web apps, Open Source):
> > http://www.orbeon.com/blog/
> >
> >
>
>
>
>
> --
> 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
>
>
>

--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

RE: Xinclude and absolute paths

Alex Brown-5
In reply to this post by Alex Brown-5
Alex hi

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf
> Of Alessandro Vernet
> Sent: 20 December 2006 04:39
> To: [hidden email]
> Subject: Re: [ops-users] Xinclude and absolute paths
>
> Hi Alex,
>
> Just to make I understand your question, you would like to be
> able to write:
>
> <xi:include href='/xforms-jsp/my.jsp'/>
Yes please! And if I have some XPL that emits content I'd like to use a
URL like:

<xi:include href='/my-pipeline'/>
 
> But right now you have to write:
>
> <xi:include href='/your-app/xforms-jsp/my.jsp'/>

That doesn't work for me: I get a "cannot load ... with webapp loader"
error for that kind of path.

What _does_ work is using the a fully-qualifed absolute URL starting
http://localhost:8080/myapp/...
 
> Where "your-app" is the context of your application. Is that right?

Yes, in other words I'd like to know what "/" resolves to in an URL in
an Orbeon application. When the URL is subject to rewriting it resolves
to the application context, but when the URL is not rewritten I don't
understand what determines/controls what '/' is. Maybe this is a Tomcat
question rather than an Orbeon one??

- Alex.

 

> Alex
>
> On 12/18/06, Alex Brown <[hidden email]> wrote:
> > Alex hi
> >
> > Thanks for your response. I'd be happy to modify the Java source if
> > necessary, BUT it's not a URL in the _result of_ the JSP I wish to
> > process, but the URL _of_ the JSP resource as used in the href
> > attribute of an XInclude directive.
> >
> > i.e. I'd like
> >
> > <xi:include href='/xforms-jsp/my.jsp'/>
> >
> > Or
> >
> > <xi:include href='/my-pipeline-produced-content'/>
> >
> > To "just work".
> >
> > I think I may be missing something fundamental - it seems I
> can't use
> > XInclude to include XPL results or JSP results withour
> hard-coding a
> > full absolute URL in the Xinclude's href, since these hrefs aren't
> > subject to URL rewriting. If only I knew the application
> context path,
> > I could synthesise an absolute URL with confidence -- is
> there a way
> > to determine the application context path (e.g.
> > "http://localhost:8080/myapp/" ?)
> >
> > - Alex.
> >
> > > -----Original Message-----
> > > From: [hidden email] [mailto:[hidden email]] On Behalf Of
> > > Alessandro Vernet
> > > Sent: 16 December 2006 01:32
> > > To: [hidden email]
> > > Subject: Re: [ops-users] Xinclude and absolute paths
> > >
> > > Alex,
> > >
> > > If you want the URL to be re-written in this case, you have to
> > > modify the Orbeon Forms Java code. And if you do, this is change
> > > that we'll be interested in integrating in Orbeon Forms. Here are
> > > few pointers:
> > >
> > > * filter.xpl is the pipeline that runs after your JSP runs.
> > > * It executes the oxf:servlet-filter-generator processor
> which will
> > > parse the data generated by the JSP.
> > > * The interesting code that triggers does the parsing in Orbeon
> > > Forms is in StreamInterceptor.parse().
> > >
> > > I hope this helps,
> > >
> > > Alex
> > >
> > > On 12/11/06, Alex Brown <[hidden email]> wrote:
> > > > Dear all,
> > > >
> > > > I have a JSP (in /xforms-jsp/) whose output I wish to access at
> > > > various points in an application.
> > > >
> > > > To include the content in a web page I can
> > > >
> > > >         <xi:include
> > > > href='http://localhost:8080/myapp/xforms-jsp/my.jsp'/>
> > > >
> > > > With no problem, but if I use an absolute path (which I
> > > want to do, so
> > > > as not to have to hard-code host, port, etc.)
> > > >
> > > >         <xi:include href='/xforms-jsp/my.jsp'/>
> > > >
> > > > Then OPS cannot load the resource, though
> > > >
> > > >         <a href='/xforms-jsp/my.jsp'>click</a>
> > > >
> > > > works fine (because URL re-writing prepends the context path to
> > > > the URL in this case?)
> > > >
> > > > How can I get URL re-writing to work for XIncludes, or -
> > > better - how
> > > > can I know how the application interprets all absolute
> paths, with
> > > > confidence?
> > > >
> > > > - Alex.
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > 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
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > Blog (XML, Web apps, Open Source):
> > > http://www.orbeon.com/blog/
> > >
> > >
> >
> >
> >
> >
> > --
> > 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
> >
> >
> >
>
>
> --
> Blog (XML, Web apps, Open Source):
> http://www.orbeon.com/blog/
>
>


--
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: Xinclude and absolute paths

Alessandro  Vernet
Administrator
Alex,

On 12/20/06, Alex Brown <[hidden email]> wrote:
> > Just to make I understand your question, you would like to be
> > able to write:
> >
> > <xi:include href='/xforms-jsp/my.jsp'/>
>
> Yes please!

So right now you can't do that, because your <xi:include
href='/xforms-jsp/my.jsp'/> will be replaced by what is at
http://localhost:8080/xforms-jsp/my.jsp. This fails as your JSP is at
http://localhost:8080/your-app/xforms-jsp/my.jsp. To make this work
the way you want, you will have to modify some Java code in Orbeon
Forms.

> > <xi:include href='/your-app/xforms-jsp/my.jsp'/>
>
> That doesn't work for me: I get a "cannot load ... with webapp loader"
> error for that kind of path.

That should work. At least I think had the other day an example where
this worked :). Can you create a reproducible use case with 2 JSP
files that I can drop in xforms-jsp to see this?

Now, where do you need this? Is it to have an initial instance
generated by another JSP file?

Alex
--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet