Problems call OPS from JSTL

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

RE: Problems call OPS from JSTL

Ryan Puddephatt
Alex,
        This won't work for me I'm afraid because we don't have direct
access to our production machines so we can't amend the URL to suit this.

Reading the tomcat configuration documentation
(http://tomcat.apache.org/tomcat-5.5-doc/config/context.html) I noticed the
crossContext property says this:

Set to true if you want calls within this application to
ServletContext.getContext() to successfully return a request dispatcher for
other web applications running on this virtual host. Set to false (the
default) in security conscious environments, to make getContext() always
return null.

I need the crossContext set to true for c:import/@context to function so
maybe to problem lies with the use of the ServletContext object?

Ryan

Ryan Puddephatt
Software Engineer
TFX Group - IT UK
1 Michaelson Square
Livingston
West Lothian
Scotand
EH54 7DP
 
* [hidden email]
( 01506 407 110
7  01506 407 108
 

>-----Original Message-----
>From: [hidden email] [mailto:[hidden email]] On Behalf Of Alessandro
>Vernet
>Sent: 11 July 2006 09:25
>To: [hidden email]
>Subject: Re: [ops-users] Problems call OPS from JSTL
>
>Hi Ryan,
>
>OPS returns a page not found, because calling methods like
>request.getRequestURI() in this case apparently returns the original
>URL, not the URL requested by the c:import. With Tomcat, we can get
>from within the OPS servlet the path the request was dispatched to
>with:
>
>request.getAttribute("org.apache.catalina.core.DISPATCHER_REQUEST_PATH")
>
>I am surprised by this behavior, but it looks like a way around it is
>to specify a full URL with no context in c:import, as in:
>
><c:import var="tagXML" url="http://localhost:8080/ops/xforms-controls"/>
>
>This seems to be working fine. Is this an acceptable solution in your case?
>
>Alex
>
>On 7/6/06, Ryan Puddephatt <[hidden email]> wrote:
>> Erik/Alex,
>>         Any joy with finding this problem when making a context call in
>JSP?
>>
>> Thanks
>>
>> Ryan
>>
>> Ryan Puddephatt
>> Software Engineer
>> TFX Group - IT UK
>> 1 Michaelson Square
>> Livingston
>> West Lothian
>> Scotand
>> EH54 7DP
>>
>> * [hidden email]
>> ( 01506 407 110
>> 7  01506 407 108
>>
>> >-----Original Message-----
>> >From: Ryan Puddephatt [mailto:[hidden email]]
>> >Sent: 05 June 2006 12:06
>> >To: [hidden email]
>> >Subject: RE: [ops-users] Problems call OPS from JSTL
>> >
>> >Erik,
>> >       Any joy with this?
>> >
>> >Thanks Ryan
>> >
>> >Ryan Puddephatt
>> >Software Engineer
>> >TFX Group - IT UK
>> >1 Michaelson Square
>> >Livingston
>> >West Lothian
>> >Scotand
>> >EH54 7DP
>> >
>> >* [hidden email]
>> >( 01506 407 110
>> >7  01506 407 108
>> >
>> >
>> >>-----Original Message-----
>> >>From: Ryan Puddephatt [mailto:[hidden email]]
>> >>Sent: 16 May 2006 12:43
>> >>To: [hidden email]
>> >>Subject: RE: [ops-users] Problems call OPS from JSTL
>> >>
>> >>Erik,
>> >>      Attached is jspapp.null I've had to rename it from zip as it
>won't
>> >>get past our email filters! For an OPS app you just need something that
>> >>returns XML. Within the JSP app in file /jsp/index.jsp change
><c:import>
>> >to
>> >>the appropriate @context and @url.
>> >>
>> >>When loading the JSP page you will see that it returns the not found
>page
>> >>rather than the xml you wanted.
>> >>
>> >>Ryan
>> >>
>> >>Ryan Puddephatt
>> >>Software Engineer
>> >>TFX Group - IT UK
>> >>1 Michaelson Square
>> >>Livingston
>> >>West Lothian
>> >>Scotand
>> >>EH54 7DP
>> >>
>> >>* [hidden email]
>> >>( 01506 407 110
>> >>7  01506 407 108
>> >>
>> >>>-----Original Message-----
>> >>>From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik
>Bruchez
>> >>>Sent: 11 May 2006 23:48
>> >>>To: [hidden email]
>> >>>Subject: Re: [ops-users] Problems call OPS from JSTL
>> >>>
>> >>>Sure, that would help.
>> >>>
>> >>>-Erik
>> >>>
>> >>>Ryan Puddephatt wrote:
>> >>>> Erik,
>> >>>>    The problem still exists, even when I change this propertie,
>would
>> >>>> you like me to get a test case together, it will be a JSP and a OPS
>> >app?
>> >>>>
>> >>>> Ryan
>> >>>>
>> >>>> Ryan Puddephatt
>> >>>> Software Engineer
>> >>>> TFX Group - IT UK
>> >>>> 1 Michaelson Square
>> >>>> Livingston
>> >>>> West Lothian
>> >>>> Scotand
>> >>>> EH54 7DP
>> >>>>
>> >>>> * [hidden email]
>> >>>> ( 01506 407 110
>> >>>> 7  01506 407 108
>> >>>>
>> >>>>> -----Original Message-----
>> >>>>> From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik
>> >>Bruchez
>> >>>>> Sent: 03 May 2006 19:37
>> >>>>> To: [hidden email]
>> >>>>> Subject: Re: [ops-users] Problems call OPS from JSTL
>> >>>>>
>> >>>>> Ryan Puddephatt wrote:
>> >>>>>> Alex,
>> >>>>>>  Any ideas as to what is causing this problem? I'm having to do
>> >a
>> >>>>>> major hack to catch a 404 at the moment and I'd rather tidy it up!
>I
>> >>>>> looked
>> >>>>>> at the Apache Tomcat docs
>> >>>>>> (http://tomcat.apache.org/tomcat-5.5-doc/config/context.html) and
>> >>found
>> >>>>> that
>> >>>>>> crossContext uses the following
>> >>>>>>
>> >>>>>> Set to true if you want calls within this application to
>> >>>>>> ServletContext.getContext() to successfully return a request
>> >>dispatcher
>> >>>>> for
>> >>>>>> other web applications running on this virtual host. Set to false
>> >(the
>> >>>>>> default) in security conscious environments, to make getContext()
>> >>>always
>> >>>>>> return null.
>> >>>>>>
>> >>>>>> It seems like the call is made internally through Tomcat rather
>than
>> >a
>> >>>>> full
>> >>>>>> http call. I noticed the URL that OPS shows as receiving is the
>URL
>> >>the
>> >>>>> call
>> >>>>>> is coming from and not the URL being called, also the oxf:request
>> >>>>> processor
>> >>>>>> gives the request information for the calling page, as if it is
>> >>>>> forwarded.
>> >>>>>
>> >>>>> You can force OPS to not optimize local HTTP requests by setting a
>> >>>>> property to false in properties.xml:
>> >>>>>
>> >>>>> <property as="xs:boolean" name="oxf.xforms.optimize-local-
>submission"
>> >>>>>          value="false"/>
>> >>>>>
>> >>>>> Maybe this will help.
>> >>>>>
>> >>>>> -Erik
>> >>>>>
>> >>>>> --
>> >>>>> Orbeon - XForms Everywhere:
>> >>>>> http://www.orbeon.com/blog/
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>> --------------------------------------------------------------------
>---
>> >-
>> >>>>
>> >>>>
>> >>>> --
>> >>>> You receive this message as a subscriber of the ops-
>[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
>> >>>
>> >>>
>> >>>--
>> >>>Orbeon - XForms Everywhere:
>> >>>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: Problems call OPS from JSTL

Alessandro  Vernet
Administrator
Ryan,

The context object is only used on the caller side, that is the JSTL
side. In OPS we get a request, and from the request, we should be able
to get the requested URI with request.getRequestURI(). The problem is
that this call does not return the URI you specify in the c:import,
but the URI requested by your browser.

I am not sure what to make of this, so I asked a question in the
tomcat-users list, and we'll see if I get a useful response.

Alex

On 7/11/06, Ryan Puddephatt <[hidden email]> wrote:

> Alex,
>         This won't work for me I'm afraid because we don't have direct
> access to our production machines so we can't amend the URL to suit this.
>
> Reading the tomcat configuration documentation
> (http://tomcat.apache.org/tomcat-5.5-doc/config/context.html) I noticed the
> crossContext property says this:
>
> Set to true if you want calls within this application to
> ServletContext.getContext() to successfully return a request dispatcher for
> other web applications running on this virtual host. Set to false (the
> default) in security conscious environments, to make getContext() always
> return null.
>
> I need the crossContext set to true for c:import/@context to function so
> maybe to problem lies with the use of the ServletContext object?
>
> Ryan
>
> Ryan Puddephatt
> Software Engineer
> TFX Group - IT UK
> 1 Michaelson Square
> Livingston
> West Lothian
> Scotand
> EH54 7DP
>
> * [hidden email]
> ( 01506 407 110
> 7  01506 407 108
>
> >-----Original Message-----
> >From: [hidden email] [mailto:[hidden email]] On Behalf Of Alessandro
> >Vernet
> >Sent: 11 July 2006 09:25
> >To: [hidden email]
> >Subject: Re: [ops-users] Problems call OPS from JSTL
> >
> >Hi Ryan,
> >
> >OPS returns a page not found, because calling methods like
> >request.getRequestURI() in this case apparently returns the original
> >URL, not the URL requested by the c:import. With Tomcat, we can get
> >from within the OPS servlet the path the request was dispatched to
> >with:
> >
> >request.getAttribute("org.apache.catalina.core.DISPATCHER_REQUEST_PATH")
> >
> >I am surprised by this behavior, but it looks like a way around it is
> >to specify a full URL with no context in c:import, as in:
> >
> ><c:import var="tagXML" url="http://localhost:8080/ops/xforms-controls"/>
> >
> >This seems to be working fine. Is this an acceptable solution in your case?
> >
> >Alex
> >
> >On 7/6/06, Ryan Puddephatt <[hidden email]> wrote:
> >> Erik/Alex,
> >>         Any joy with finding this problem when making a context call in
> >JSP?
> >>
> >> Thanks
> >>
> >> Ryan
> >>
> >> Ryan Puddephatt
> >> Software Engineer
> >> TFX Group - IT UK
> >> 1 Michaelson Square
> >> Livingston
> >> West Lothian
> >> Scotand
> >> EH54 7DP
> >>
> >> * [hidden email]
> >> ( 01506 407 110
> >> 7  01506 407 108
> >>
> >> >-----Original Message-----
> >> >From: Ryan Puddephatt [mailto:[hidden email]]
> >> >Sent: 05 June 2006 12:06
> >> >To: [hidden email]
> >> >Subject: RE: [ops-users] Problems call OPS from JSTL
> >> >
> >> >Erik,
> >> >       Any joy with this?
> >> >
> >> >Thanks Ryan
> >> >
> >> >Ryan Puddephatt
> >> >Software Engineer
> >> >TFX Group - IT UK
> >> >1 Michaelson Square
> >> >Livingston
> >> >West Lothian
> >> >Scotand
> >> >EH54 7DP
> >> >
> >> >* [hidden email]
> >> >( 01506 407 110
> >> >7  01506 407 108
> >> >
> >> >
> >> >>-----Original Message-----
> >> >>From: Ryan Puddephatt [mailto:[hidden email]]
> >> >>Sent: 16 May 2006 12:43
> >> >>To: [hidden email]
> >> >>Subject: RE: [ops-users] Problems call OPS from JSTL
> >> >>
> >> >>Erik,
> >> >>      Attached is jspapp.null I've had to rename it from zip as it
> >won't
> >> >>get past our email filters! For an OPS app you just need something that
> >> >>returns XML. Within the JSP app in file /jsp/index.jsp change
> ><c:import>
> >> >to
> >> >>the appropriate @context and @url.
> >> >>
> >> >>When loading the JSP page you will see that it returns the not found
> >page
> >> >>rather than the xml you wanted.
> >> >>
> >> >>Ryan
> >> >>
> >> >>Ryan Puddephatt
> >> >>Software Engineer
> >> >>TFX Group - IT UK
> >> >>1 Michaelson Square
> >> >>Livingston
> >> >>West Lothian
> >> >>Scotand
> >> >>EH54 7DP
> >> >>
> >> >>* [hidden email]
> >> >>( 01506 407 110
> >> >>7  01506 407 108
> >> >>
> >> >>>-----Original Message-----
> >> >>>From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik
> >Bruchez
> >> >>>Sent: 11 May 2006 23:48
> >> >>>To: [hidden email]
> >> >>>Subject: Re: [ops-users] Problems call OPS from JSTL
> >> >>>
> >> >>>Sure, that would help.
> >> >>>
> >> >>>-Erik
> >> >>>
> >> >>>Ryan Puddephatt wrote:
> >> >>>> Erik,
> >> >>>>    The problem still exists, even when I change this propertie,
> >would
> >> >>>> you like me to get a test case together, it will be a JSP and a OPS
> >> >app?
> >> >>>>
> >> >>>> Ryan
> >> >>>>
> >> >>>> Ryan Puddephatt
> >> >>>> Software Engineer
> >> >>>> TFX Group - IT UK
> >> >>>> 1 Michaelson Square
> >> >>>> Livingston
> >> >>>> West Lothian
> >> >>>> Scotand
> >> >>>> EH54 7DP
> >> >>>>
> >> >>>> * [hidden email]
> >> >>>> ( 01506 407 110
> >> >>>> 7  01506 407 108
> >> >>>>
> >> >>>>> -----Original Message-----
> >> >>>>> From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik
> >> >>Bruchez
> >> >>>>> Sent: 03 May 2006 19:37
> >> >>>>> To: [hidden email]
> >> >>>>> Subject: Re: [ops-users] Problems call OPS from JSTL
> >> >>>>>
> >> >>>>> Ryan Puddephatt wrote:
> >> >>>>>> Alex,
> >> >>>>>>  Any ideas as to what is causing this problem? I'm having to do
> >> >a
> >> >>>>>> major hack to catch a 404 at the moment and I'd rather tidy it up!
> >I
> >> >>>>> looked
> >> >>>>>> at the Apache Tomcat docs
> >> >>>>>> (http://tomcat.apache.org/tomcat-5.5-doc/config/context.html) and
> >> >>found
> >> >>>>> that
> >> >>>>>> crossContext uses the following
> >> >>>>>>
> >> >>>>>> Set to true if you want calls within this application to
> >> >>>>>> ServletContext.getContext() to successfully return a request
> >> >>dispatcher
> >> >>>>> for
> >> >>>>>> other web applications running on this virtual host. Set to false
> >> >(the
> >> >>>>>> default) in security conscious environments, to make getContext()
> >> >>>always
> >> >>>>>> return null.
> >> >>>>>>
> >> >>>>>> It seems like the call is made internally through Tomcat rather
> >than
> >> >a
> >> >>>>> full
> >> >>>>>> http call. I noticed the URL that OPS shows as receiving is the
> >URL
> >> >>the
> >> >>>>> call
> >> >>>>>> is coming from and not the URL being called, also the oxf:request
> >> >>>>> processor
> >> >>>>>> gives the request information for the calling page, as if it is
> >> >>>>> forwarded.
> >> >>>>>
> >> >>>>> You can force OPS to not optimize local HTTP requests by setting a
> >> >>>>> property to false in properties.xml:
> >> >>>>>
> >> >>>>> <property as="xs:boolean" name="oxf.xforms.optimize-local-
> >submission"
> >> >>>>>          value="false"/>
> >> >>>>>
> >> >>>>> Maybe this will help.
> >> >>>>>
> >> >>>>> -Erik
> >> >>>>>
> >> >>>>> --
> >> >>>>> Orbeon - XForms Everywhere:
> >> >>>>> http://www.orbeon.com/blog/
> >> >>>>
> >> >>>>
> >> >>>>
> >> >>>>
> >> >>>> --------------------------------------------------------------------
> >---
> >> >-
> >> >>>>
> >> >>>>
> >> >>>> --
> >> >>>> You receive this message as a subscriber of the ops-
> >[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
> >> >>>
> >> >>>
> >> >>>--
> >> >>>Orbeon - XForms Everywhere:
> >> >>>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
>
>
>

--
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: Problems call OPS from JSTL

Alessandro  Vernet
Administrator
Hi Ryan,

To follow-up on this: I have posted a question on the tomcat users
mailing list on Jul 12 which didn't get an answer so far. So it looks
like this issue will stay open, as we depend on Tomcat for passing us
the correct request URI, and I don't know what we can do in this case
as it looks like we don't receive the correct request URI from Tomcat.

Alex

On 7/12/06, Alessandro Vernet <[hidden email]> wrote:

> Ryan,
>
> The context object is only used on the caller side, that is the JSTL
> side. In OPS we get a request, and from the request, we should be able
> to get the requested URI with request.getRequestURI(). The problem is
> that this call does not return the URI you specify in the c:import,
> but the URI requested by your browser.
>
> I am not sure what to make of this, so I asked a question in the
> tomcat-users list, and we'll see if I get a useful response.
>
> Alex
>
> On 7/11/06, Ryan Puddephatt <[hidden email]> wrote:
> > Alex,
> >         This won't work for me I'm afraid because we don't have direct
> > access to our production machines so we can't amend the URL to suit this.
> >
> > Reading the tomcat configuration documentation
> > (http://tomcat.apache.org/tomcat-5.5-doc/config/context.html) I noticed the
> > crossContext property says this:
> >
> > Set to true if you want calls within this application to
> > ServletContext.getContext() to successfully return a request dispatcher for
> > other web applications running on this virtual host. Set to false (the
> > default) in security conscious environments, to make getContext() always
> > return null.
> >
> > I need the crossContext set to true for c:import/@context to function so
> > maybe to problem lies with the use of the ServletContext object?
> >
> > Ryan
> >
> > Ryan Puddephatt
> > Software Engineer
> > TFX Group - IT UK
> > 1 Michaelson Square
> > Livingston
> > West Lothian
> > Scotand
> > EH54 7DP
> >
> > * [hidden email]
> > ( 01506 407 110
> > 7  01506 407 108
> >
> > >-----Original Message-----
> > >From: [hidden email] [mailto:[hidden email]] On Behalf Of Alessandro
> > >Vernet
> > >Sent: 11 July 2006 09:25
> > >To: [hidden email]
> > >Subject: Re: [ops-users] Problems call OPS from JSTL
> > >
> > >Hi Ryan,
> > >
> > >OPS returns a page not found, because calling methods like
> > >request.getRequestURI() in this case apparently returns the original
> > >URL, not the URL requested by the c:import. With Tomcat, we can get
> > >from within the OPS servlet the path the request was dispatched to
> > >with:
> > >
> > >request.getAttribute("org.apache.catalina.core.DISPATCHER_REQUEST_PATH")
> > >
> > >I am surprised by this behavior, but it looks like a way around it is
> > >to specify a full URL with no context in c:import, as in:
> > >
> > ><c:import var="tagXML" url="http://localhost:8080/ops/xforms-controls"/>
> > >
> > >This seems to be working fine. Is this an acceptable solution in your case?
> > >
> > >Alex
> > >
> > >On 7/6/06, Ryan Puddephatt <[hidden email]> wrote:
> > >> Erik/Alex,
> > >>         Any joy with finding this problem when making a context call in
> > >JSP?
> > >>
> > >> Thanks
> > >>
> > >> Ryan
> > >>
> > >> Ryan Puddephatt
> > >> Software Engineer
> > >> TFX Group - IT UK
> > >> 1 Michaelson Square
> > >> Livingston
> > >> West Lothian
> > >> Scotand
> > >> EH54 7DP
> > >>
> > >> * [hidden email]
> > >> ( 01506 407 110
> > >> 7  01506 407 108
> > >>
> > >> >-----Original Message-----
> > >> >From: Ryan Puddephatt [mailto:[hidden email]]
> > >> >Sent: 05 June 2006 12:06
> > >> >To: [hidden email]
> > >> >Subject: RE: [ops-users] Problems call OPS from JSTL
> > >> >
> > >> >Erik,
> > >> >       Any joy with this?
> > >> >
> > >> >Thanks Ryan
> > >> >
> > >> >Ryan Puddephatt
> > >> >Software Engineer
> > >> >TFX Group - IT UK
> > >> >1 Michaelson Square
> > >> >Livingston
> > >> >West Lothian
> > >> >Scotand
> > >> >EH54 7DP
> > >> >
> > >> >* [hidden email]
> > >> >( 01506 407 110
> > >> >7  01506 407 108
> > >> >
> > >> >
> > >> >>-----Original Message-----
> > >> >>From: Ryan Puddephatt [mailto:[hidden email]]
> > >> >>Sent: 16 May 2006 12:43
> > >> >>To: [hidden email]
> > >> >>Subject: RE: [ops-users] Problems call OPS from JSTL
> > >> >>
> > >> >>Erik,
> > >> >>      Attached is jspapp.null I've had to rename it from zip as it
> > >won't
> > >> >>get past our email filters! For an OPS app you just need something that
> > >> >>returns XML. Within the JSP app in file /jsp/index.jsp change
> > ><c:import>
> > >> >to
> > >> >>the appropriate @context and @url.
> > >> >>
> > >> >>When loading the JSP page you will see that it returns the not found
> > >page
> > >> >>rather than the xml you wanted.
> > >> >>
> > >> >>Ryan
> > >> >>
> > >> >>Ryan Puddephatt
> > >> >>Software Engineer
> > >> >>TFX Group - IT UK
> > >> >>1 Michaelson Square
> > >> >>Livingston
> > >> >>West Lothian
> > >> >>Scotand
> > >> >>EH54 7DP
> > >> >>
> > >> >>* [hidden email]
> > >> >>( 01506 407 110
> > >> >>7  01506 407 108
> > >> >>
> > >> >>>-----Original Message-----
> > >> >>>From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik
> > >Bruchez
> > >> >>>Sent: 11 May 2006 23:48
> > >> >>>To: [hidden email]
> > >> >>>Subject: Re: [ops-users] Problems call OPS from JSTL
> > >> >>>
> > >> >>>Sure, that would help.
> > >> >>>
> > >> >>>-Erik
> > >> >>>
> > >> >>>Ryan Puddephatt wrote:
> > >> >>>> Erik,
> > >> >>>>    The problem still exists, even when I change this propertie,
> > >would
> > >> >>>> you like me to get a test case together, it will be a JSP and a OPS
> > >> >app?
> > >> >>>>
> > >> >>>> Ryan
> > >> >>>>
> > >> >>>> Ryan Puddephatt
> > >> >>>> Software Engineer
> > >> >>>> TFX Group - IT UK
> > >> >>>> 1 Michaelson Square
> > >> >>>> Livingston
> > >> >>>> West Lothian
> > >> >>>> Scotand
> > >> >>>> EH54 7DP
> > >> >>>>
> > >> >>>> * [hidden email]
> > >> >>>> ( 01506 407 110
> > >> >>>> 7  01506 407 108
> > >> >>>>
> > >> >>>>> -----Original Message-----
> > >> >>>>> From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik
> > >> >>Bruchez
> > >> >>>>> Sent: 03 May 2006 19:37
> > >> >>>>> To: [hidden email]
> > >> >>>>> Subject: Re: [ops-users] Problems call OPS from JSTL
> > >> >>>>>
> > >> >>>>> Ryan Puddephatt wrote:
> > >> >>>>>> Alex,
> > >> >>>>>>  Any ideas as to what is causing this problem? I'm having to do
> > >> >a
> > >> >>>>>> major hack to catch a 404 at the moment and I'd rather tidy it up!
> > >I
> > >> >>>>> looked
> > >> >>>>>> at the Apache Tomcat docs
> > >> >>>>>> (http://tomcat.apache.org/tomcat-5.5-doc/config/context.html) and
> > >> >>found
> > >> >>>>> that
> > >> >>>>>> crossContext uses the following
> > >> >>>>>>
> > >> >>>>>> Set to true if you want calls within this application to
> > >> >>>>>> ServletContext.getContext() to successfully return a request
> > >> >>dispatcher
> > >> >>>>> for
> > >> >>>>>> other web applications running on this virtual host. Set to false
> > >> >(the
> > >> >>>>>> default) in security conscious environments, to make getContext()
> > >> >>>always
> > >> >>>>>> return null.
> > >> >>>>>>
> > >> >>>>>> It seems like the call is made internally through Tomcat rather
> > >than
> > >> >a
> > >> >>>>> full
> > >> >>>>>> http call. I noticed the URL that OPS shows as receiving is the
> > >URL
> > >> >>the
> > >> >>>>> call
> > >> >>>>>> is coming from and not the URL being called, also the oxf:request
> > >> >>>>> processor
> > >> >>>>>> gives the request information for the calling page, as if it is
> > >> >>>>> forwarded.
> > >> >>>>>
> > >> >>>>> You can force OPS to not optimize local HTTP requests by setting a
> > >> >>>>> property to false in properties.xml:
> > >> >>>>>
> > >> >>>>> <property as="xs:boolean" name="oxf.xforms.optimize-local-
> > >submission"
> > >> >>>>>          value="false"/>
> > >> >>>>>
> > >> >>>>> Maybe this will help.
> > >> >>>>>
> > >> >>>>> -Erik
> > >> >>>>>
> > >> >>>>> --
> > >> >>>>> Orbeon - XForms Everywhere:
> > >> >>>>> http://www.orbeon.com/blog/
> > >> >>>>
> > >> >>>>
> > >> >>>>
> > >> >>>>
> > >> >>>> --------------------------------------------------------------------
> > >---
> > >> >-
> > >> >>>>
> > >> >>>>
> > >> >>>> --
> > >> >>>> You receive this message as a subscriber of the ops-
> > >[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
> > >> >>>
> > >> >>>
> > >> >>>--
> > >> >>>Orbeon - XForms Everywhere:
> > >> >>>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
> >
> >
> >
>
>
> --
> Blog (XML, Web apps, Open Source):
> http://www.orbeon.com/blog/
>

--
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: Problems call OPS from JSTL

Ryan Puddephatt
Alex,
        Thanks for your help on this, I'll try and investigate it a little
more, see if there is a common way to handle this response. What java file
handles the request, in case I need to experiment?

Ryan

Ryan Puddephatt
Software Engineer

Teleflex Group - IT UK
1 Michaelson Square
Livingston
West Lothian
Scotland
EH54 7DP

e> [hidden email]
t> +44(0)1506 407 110
f> +44(0)1506 407 108

 

>-----Original Message-----
>From: [hidden email] [mailto:[hidden email]] On Behalf
>Of Alessandro Vernet
>Sent: 25 July 2006 02:25
>To: [hidden email]
>Subject: Re: [ops-users] Problems call OPS from JSTL
>
>Hi Ryan,
>
>To follow-up on this: I have posted a question on the tomcat
>users mailing list on Jul 12 which didn't get an answer so
>far. So it looks like this issue will stay open, as we depend
>on Tomcat for passing us the correct request URI, and I don't
>know what we can do in this case as it looks like we don't
>receive the correct request URI from Tomcat.
>
>Alex
>
>On 7/12/06, Alessandro Vernet <[hidden email]> wrote:
>> Ryan,
>>
>> The context object is only used on the caller side, that is the JSTL
>> side. In OPS we get a request, and from the request, we
>should be able
>> to get the requested URI with request.getRequestURI(). The
>problem is
>> that this call does not return the URI you specify in the c:import,
>> but the URI requested by your browser.
>>
>> I am not sure what to make of this, so I asked a question in the
>> tomcat-users list, and we'll see if I get a useful response.
>>
>> Alex
>>
>> On 7/11/06, Ryan Puddephatt <[hidden email]> wrote:
>> > Alex,
>> >         This won't work for me I'm afraid because we don't have
>> > direct access to our production machines so we can't amend
>the URL to suit this.
>> >
>> > Reading the tomcat configuration documentation
>> > (http://tomcat.apache.org/tomcat-5.5-doc/config/context.html) I
>> > noticed the crossContext property says this:
>> >
>> > Set to true if you want calls within this application to
>> > ServletContext.getContext() to successfully return a request
>> > dispatcher for other web applications running on this
>virtual host.
>> > Set to false (the
>> > default) in security conscious environments, to make getContext()
>> > always return null.
>> >
>> > I need the crossContext set to true for c:import/@context to
>> > function so maybe to problem lies with the use of the
>ServletContext object?
>> >
>> > Ryan
>> >
>> > Ryan Puddephatt
>> > Software Engineer
>> > TFX Group - IT UK
>> > 1 Michaelson Square
>> > Livingston
>> > West Lothian
>> > Scotand
>> > EH54 7DP
>> >
>> > * [hidden email]
>> > ( 01506 407 110
>> > 7  01506 407 108
>> >
>> > >-----Original Message-----
>> > >From: [hidden email] [mailto:[hidden email]] On Behalf Of
>> > >Alessandro Vernet
>> > >Sent: 11 July 2006 09:25
>> > >To: [hidden email]
>> > >Subject: Re: [ops-users] Problems call OPS from JSTL
>> > >
>> > >Hi Ryan,
>> > >
>> > >OPS returns a page not found, because calling methods like
>> > >request.getRequestURI() in this case apparently returns the
>> > >original URL, not the URL requested by the c:import. With Tomcat,
>> > >we can get from within the OPS servlet the path the request was
>> > >dispatched to
>> > >with:
>> > >
>> >
>>request.getAttribute("org.apache.catalina.core.DISPATCHER_REQUEST_P
>> > >ATH")
>> > >
>> > >I am surprised by this behavior, but it looks like a way
>around it
>> > >is to specify a full URL with no context in c:import, as in:
>> > >
>> > ><c:import var="tagXML"
>> > >url="http://localhost:8080/ops/xforms-controls"/>
>> > >
>> > >This seems to be working fine. Is this an acceptable
>solution in your case?
>> > >
>> > >Alex
>> > >
>> > >On 7/6/06, Ryan Puddephatt <[hidden email]> wrote:
>> > >> Erik/Alex,
>> > >>         Any joy with finding this problem when making a context
>> > >> call in
>> > >JSP?
>> > >>
>> > >> Thanks
>> > >>
>> > >> Ryan
>> > >>
>> > >> Ryan Puddephatt
>> > >> Software Engineer
>> > >> TFX Group - IT UK
>> > >> 1 Michaelson Square
>> > >> Livingston
>> > >> West Lothian
>> > >> Scotand
>> > >> EH54 7DP
>> > >>
>> > >> * [hidden email]
>> > >> ( 01506 407 110
>> > >> 7  01506 407 108
>> > >>
>> > >> >-----Original Message-----
>> > >> >From: Ryan Puddephatt [mailto:[hidden email]]
>> > >> >Sent: 05 June 2006 12:06
>> > >> >To: [hidden email]
>> > >> >Subject: RE: [ops-users] Problems call OPS from JSTL
>> > >> >
>> > >> >Erik,
>> > >> >       Any joy with this?
>> > >> >
>> > >> >Thanks Ryan
>> > >> >
>> > >> >Ryan Puddephatt
>> > >> >Software Engineer
>> > >> >TFX Group - IT UK
>> > >> >1 Michaelson Square
>> > >> >Livingston
>> > >> >West Lothian
>> > >> >Scotand
>> > >> >EH54 7DP
>> > >> >
>> > >> >* [hidden email]
>> > >> >( 01506 407 110
>> > >> >7  01506 407 108
>> > >> >
>> > >> >
>> > >> >>-----Original Message-----
>> > >> >>From: Ryan Puddephatt [mailto:[hidden email]]
>> > >> >>Sent: 16 May 2006 12:43
>> > >> >>To: [hidden email]
>> > >> >>Subject: RE: [ops-users] Problems call OPS from JSTL
>> > >> >>
>> > >> >>Erik,
>> > >> >>      Attached is jspapp.null I've had to rename it
>from zip as
>> > >> >>it
>> > >won't
>> > >> >>get past our email filters! For an OPS app you just need
>> > >> >>something that returns XML. Within the JSP app in file
>> > >> >>/jsp/index.jsp change
>> > ><c:import>
>> > >> >to
>> > >> >>the appropriate @context and @url.
>> > >> >>
>> > >> >>When loading the JSP page you will see that it
>returns the not
>> > >> >>found
>> > >page
>> > >> >>rather than the xml you wanted.
>> > >> >>
>> > >> >>Ryan
>> > >> >>
>> > >> >>Ryan Puddephatt
>> > >> >>Software Engineer
>> > >> >>TFX Group - IT UK
>> > >> >>1 Michaelson Square
>> > >> >>Livingston
>> > >> >>West Lothian
>> > >> >>Scotand
>> > >> >>EH54 7DP
>> > >> >>
>> > >> >>* [hidden email]
>> > >> >>( 01506 407 110
>> > >> >>7  01506 407 108
>> > >> >>
>> > >> >>>-----Original Message-----
>> > >> >>>From: Erik Bruchez [mailto:[hidden email]] On Behalf Of
>> > >> >>>Erik
>> > >Bruchez
>> > >> >>>Sent: 11 May 2006 23:48
>> > >> >>>To: [hidden email]
>> > >> >>>Subject: Re: [ops-users] Problems call OPS from JSTL
>> > >> >>>
>> > >> >>>Sure, that would help.
>> > >> >>>
>> > >> >>>-Erik
>> > >> >>>
>> > >> >>>Ryan Puddephatt wrote:
>> > >> >>>> Erik,
>> > >> >>>>    The problem still exists, even when I change this
>> > >> >>>> propertie,
>> > >would
>> > >> >>>> you like me to get a test case together, it will be a JSP
>> > >> >>>> and a OPS
>> > >> >app?
>> > >> >>>>
>> > >> >>>> Ryan
>> > >> >>>>
>> > >> >>>> Ryan Puddephatt
>> > >> >>>> Software Engineer
>> > >> >>>> TFX Group - IT UK
>> > >> >>>> 1 Michaelson Square
>> > >> >>>> Livingston
>> > >> >>>> West Lothian
>> > >> >>>> Scotand
>> > >> >>>> EH54 7DP
>> > >> >>>>
>> > >> >>>> * [hidden email]
>> > >> >>>> ( 01506 407 110
>> > >> >>>> 7  01506 407 108
>> > >> >>>>
>> > >> >>>>> -----Original Message-----
>> > >> >>>>> From: Erik Bruchez [mailto:[hidden email]] On
>Behalf Of
>> > >> >>>>> Erik
>> > >> >>Bruchez
>> > >> >>>>> Sent: 03 May 2006 19:37
>> > >> >>>>> To: [hidden email]
>> > >> >>>>> Subject: Re: [ops-users] Problems call OPS from JSTL
>> > >> >>>>>
>> > >> >>>>> Ryan Puddephatt wrote:
>> > >> >>>>>> Alex,
>> > >> >>>>>>  Any ideas as to what is causing this problem?
>I'm having
>> > >> >>>>>> to do
>> > >> >a
>> > >> >>>>>> major hack to catch a 404 at the moment and I'd
>rather tidy it up!
>> > >I
>> > >> >>>>> looked
>> > >> >>>>>> at the Apache Tomcat docs
>> > >> >>>>>>
>(http://tomcat.apache.org/tomcat-5.5-doc/config/context.ht
>> > >> >>>>>> ml) and
>> > >> >>found
>> > >> >>>>> that
>> > >> >>>>>> crossContext uses the following
>> > >> >>>>>>
>> > >> >>>>>> Set to true if you want calls within this application to
>> > >> >>>>>> ServletContext.getContext() to successfully return a
>> > >> >>>>>> request
>> > >> >>dispatcher
>> > >> >>>>> for
>> > >> >>>>>> other web applications running on this virtual host. Set
>> > >> >>>>>> to false
>> > >> >(the
>> > >> >>>>>> default) in security conscious environments, to make
>> > >> >>>>>> getContext()
>> > >> >>>always
>> > >> >>>>>> return null.
>> > >> >>>>>>
>> > >> >>>>>> It seems like the call is made internally through Tomcat
>> > >> >>>>>> rather
>> > >than
>> > >> >a
>> > >> >>>>> full
>> > >> >>>>>> http call. I noticed the URL that OPS shows as receiving
>> > >> >>>>>> is the
>> > >URL
>> > >> >>the
>> > >> >>>>> call
>> > >> >>>>>> is coming from and not the URL being called, also the
>> > >> >>>>>> oxf:request
>> > >> >>>>> processor
>> > >> >>>>>> gives the request information for the calling
>page, as if
>> > >> >>>>>> it is
>> > >> >>>>> forwarded.
>> > >> >>>>>
>> > >> >>>>> You can force OPS to not optimize local HTTP requests by
>> > >> >>>>> setting a property to false in properties.xml:
>> > >> >>>>>
>> > >> >>>>> <property as="xs:boolean" name="oxf.xforms.optimize-local-
>> > >submission"
>> > >> >>>>>          value="false"/>
>> > >> >>>>>
>> > >> >>>>> Maybe this will help.
>> > >> >>>>>
>> > >> >>>>> -Erik
>> > >> >>>>>
>> > >> >>>>> --
>> > >> >>>>> Orbeon - XForms Everywhere:
>> > >> >>>>> http://www.orbeon.com/blog/
>> > >> >>>>
>> > >> >>>>
>> > >> >>>>
>> > >> >>>>
>> > >> >>>>
>------------------------------------------------------------
>> > >> >>>> --------
>> > >---
>> > >> >-
>> > >> >>>>
>> > >> >>>>
>> > >> >>>> --
>> > >> >>>> You receive this message as a subscriber of the ops-
>> > >[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
>> > >> >>>
>> > >> >>>
>> > >> >>>--
>> > >> >>>Orbeon - XForms Everywhere:
>> > >> >>>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
>> >
>> >
>> >
>>
>>
>> --
>> Blog (XML, Web apps, Open Source):
>> http://www.orbeon.com/blog/
>>
>
>
>--
>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: Problems call OPS from JSTL

Alessandro  Vernet
Administrator
Hi Ryan,

With a debugger, you can put a breakpoint in the 'service' method of
'OPSServlet'. There you can look at what you get a in the 'request'
object, an in particular at what is returned by
request.getRequestURI().

Alex

On 7/25/06, Ryan Puddephatt <[hidden email]> wrote:

> Alex,
>         Thanks for your help on this, I'll try and investigate it a little
> more, see if there is a common way to handle this response. What java file
> handles the request, in case I need to experiment?
>
> Ryan
>
> Ryan Puddephatt
> Software Engineer
>
> Teleflex Group - IT UK
> 1 Michaelson Square
> Livingston
> West Lothian
> Scotland
> EH54 7DP
>
> e> [hidden email]
> t> +44(0)1506 407 110
> f> +44(0)1506 407 108
>
>
>
> >-----Original Message-----
> >From: [hidden email] [mailto:[hidden email]] On Behalf
> >Of Alessandro Vernet
> >Sent: 25 July 2006 02:25
> >To: [hidden email]
> >Subject: Re: [ops-users] Problems call OPS from JSTL
> >
> >Hi Ryan,
> >
> >To follow-up on this: I have posted a question on the tomcat
> >users mailing list on Jul 12 which didn't get an answer so
> >far. So it looks like this issue will stay open, as we depend
> >on Tomcat for passing us the correct request URI, and I don't
> >know what we can do in this case as it looks like we don't
> >receive the correct request URI from Tomcat.
> >
> >Alex
> >
> >On 7/12/06, Alessandro Vernet <[hidden email]> wrote:
> >> Ryan,
> >>
> >> The context object is only used on the caller side, that is the JSTL
> >> side. In OPS we get a request, and from the request, we
> >should be able
> >> to get the requested URI with request.getRequestURI(). The
> >problem is
> >> that this call does not return the URI you specify in the c:import,
> >> but the URI requested by your browser.
> >>
> >> I am not sure what to make of this, so I asked a question in the
> >> tomcat-users list, and we'll see if I get a useful response.
> >>
> >> Alex
> >>
> >> On 7/11/06, Ryan Puddephatt <[hidden email]> wrote:
> >> > Alex,
> >> >         This won't work for me I'm afraid because we don't have
> >> > direct access to our production machines so we can't amend
> >the URL to suit this.
> >> >
> >> > Reading the tomcat configuration documentation
> >> > (http://tomcat.apache.org/tomcat-5.5-doc/config/context.html) I
> >> > noticed the crossContext property says this:
> >> >
> >> > Set to true if you want calls within this application to
> >> > ServletContext.getContext() to successfully return a request
> >> > dispatcher for other web applications running on this
> >virtual host.
> >> > Set to false (the
> >> > default) in security conscious environments, to make getContext()
> >> > always return null.
> >> >
> >> > I need the crossContext set to true for c:import/@context to
> >> > function so maybe to problem lies with the use of the
> >ServletContext object?
> >> >
> >> > Ryan
> >> >
> >> > Ryan Puddephatt
> >> > Software Engineer
> >> > TFX Group - IT UK
> >> > 1 Michaelson Square
> >> > Livingston
> >> > West Lothian
> >> > Scotand
> >> > EH54 7DP
> >> >
> >> > * [hidden email]
> >> > ( 01506 407 110
> >> > 7  01506 407 108
> >> >
> >> > >-----Original Message-----
> >> > >From: [hidden email] [mailto:[hidden email]] On Behalf Of
> >> > >Alessandro Vernet
> >> > >Sent: 11 July 2006 09:25
> >> > >To: [hidden email]
> >> > >Subject: Re: [ops-users] Problems call OPS from JSTL
> >> > >
> >> > >Hi Ryan,
> >> > >
> >> > >OPS returns a page not found, because calling methods like
> >> > >request.getRequestURI() in this case apparently returns the
> >> > >original URL, not the URL requested by the c:import. With Tomcat,
> >> > >we can get from within the OPS servlet the path the request was
> >> > >dispatched to
> >> > >with:
> >> > >
> >> >
> >>request.getAttribute("org.apache.catalina.core.DISPATCHER_REQUEST_P
> >> > >ATH")
> >> > >
> >> > >I am surprised by this behavior, but it looks like a way
> >around it
> >> > >is to specify a full URL with no context in c:import, as in:
> >> > >
> >> > ><c:import var="tagXML"
> >> > >url="http://localhost:8080/ops/xforms-controls"/>
> >> > >
> >> > >This seems to be working fine. Is this an acceptable
> >solution in your case?
> >> > >
> >> > >Alex
> >> > >
> >> > >On 7/6/06, Ryan Puddephatt <[hidden email]> wrote:
> >> > >> Erik/Alex,
> >> > >>         Any joy with finding this problem when making a context
> >> > >> call in
> >> > >JSP?
> >> > >>
> >> > >> Thanks
> >> > >>
> >> > >> Ryan
> >> > >>
> >> > >> Ryan Puddephatt
> >> > >> Software Engineer
> >> > >> TFX Group - IT UK
> >> > >> 1 Michaelson Square
> >> > >> Livingston
> >> > >> West Lothian
> >> > >> Scotand
> >> > >> EH54 7DP
> >> > >>
> >> > >> * [hidden email]
> >> > >> ( 01506 407 110
> >> > >> 7  01506 407 108
> >> > >>
> >> > >> >-----Original Message-----
> >> > >> >From: Ryan Puddephatt [mailto:[hidden email]]
> >> > >> >Sent: 05 June 2006 12:06
> >> > >> >To: [hidden email]
> >> > >> >Subject: RE: [ops-users] Problems call OPS from JSTL
> >> > >> >
> >> > >> >Erik,
> >> > >> >       Any joy with this?
> >> > >> >
> >> > >> >Thanks Ryan
> >> > >> >
> >> > >> >Ryan Puddephatt
> >> > >> >Software Engineer
> >> > >> >TFX Group - IT UK
> >> > >> >1 Michaelson Square
> >> > >> >Livingston
> >> > >> >West Lothian
> >> > >> >Scotand
> >> > >> >EH54 7DP
> >> > >> >
> >> > >> >* [hidden email]
> >> > >> >( 01506 407 110
> >> > >> >7  01506 407 108
> >> > >> >
> >> > >> >
> >> > >> >>-----Original Message-----
> >> > >> >>From: Ryan Puddephatt [mailto:[hidden email]]
> >> > >> >>Sent: 16 May 2006 12:43
> >> > >> >>To: [hidden email]
> >> > >> >>Subject: RE: [ops-users] Problems call OPS from JSTL
> >> > >> >>
> >> > >> >>Erik,
> >> > >> >>      Attached is jspapp.null I've had to rename it
> >from zip as
> >> > >> >>it
> >> > >won't
> >> > >> >>get past our email filters! For an OPS app you just need
> >> > >> >>something that returns XML. Within the JSP app in file
> >> > >> >>/jsp/index.jsp change
> >> > ><c:import>
> >> > >> >to
> >> > >> >>the appropriate @context and @url.
> >> > >> >>
> >> > >> >>When loading the JSP page you will see that it
> >returns the not
> >> > >> >>found
> >> > >page
> >> > >> >>rather than the xml you wanted.
> >> > >> >>
> >> > >> >>Ryan
> >> > >> >>
> >> > >> >>Ryan Puddephatt
> >> > >> >>Software Engineer
> >> > >> >>TFX Group - IT UK
> >> > >> >>1 Michaelson Square
> >> > >> >>Livingston
> >> > >> >>West Lothian
> >> > >> >>Scotand
> >> > >> >>EH54 7DP
> >> > >> >>
> >> > >> >>* [hidden email]
> >> > >> >>( 01506 407 110
> >> > >> >>7  01506 407 108
> >> > >> >>
> >> > >> >>>-----Original Message-----
> >> > >> >>>From: Erik Bruchez [mailto:[hidden email]] On Behalf Of
> >> > >> >>>Erik
> >> > >Bruchez
> >> > >> >>>Sent: 11 May 2006 23:48
> >> > >> >>>To: [hidden email]
> >> > >> >>>Subject: Re: [ops-users] Problems call OPS from JSTL
> >> > >> >>>
> >> > >> >>>Sure, that would help.
> >> > >> >>>
> >> > >> >>>-Erik
> >> > >> >>>
> >> > >> >>>Ryan Puddephatt wrote:
> >> > >> >>>> Erik,
> >> > >> >>>>    The problem still exists, even when I change this
> >> > >> >>>> propertie,
> >> > >would
> >> > >> >>>> you like me to get a test case together, it will be a JSP
> >> > >> >>>> and a OPS
> >> > >> >app?
> >> > >> >>>>
> >> > >> >>>> Ryan
> >> > >> >>>>
> >> > >> >>>> Ryan Puddephatt
> >> > >> >>>> Software Engineer
> >> > >> >>>> TFX Group - IT UK
> >> > >> >>>> 1 Michaelson Square
> >> > >> >>>> Livingston
> >> > >> >>>> West Lothian
> >> > >> >>>> Scotand
> >> > >> >>>> EH54 7DP
> >> > >> >>>>
> >> > >> >>>> * [hidden email]
> >> > >> >>>> ( 01506 407 110
> >> > >> >>>> 7  01506 407 108
> >> > >> >>>>
> >> > >> >>>>> -----Original Message-----
> >> > >> >>>>> From: Erik Bruchez [mailto:[hidden email]] On
> >Behalf Of
> >> > >> >>>>> Erik
> >> > >> >>Bruchez
> >> > >> >>>>> Sent: 03 May 2006 19:37
> >> > >> >>>>> To: [hidden email]
> >> > >> >>>>> Subject: Re: [ops-users] Problems call OPS from JSTL
> >> > >> >>>>>
> >> > >> >>>>> Ryan Puddephatt wrote:
> >> > >> >>>>>> Alex,
> >> > >> >>>>>>  Any ideas as to what is causing this problem?
> >I'm having
> >> > >> >>>>>> to do
> >> > >> >a
> >> > >> >>>>>> major hack to catch a 404 at the moment and I'd
> >rather tidy it up!
> >> > >I
> >> > >> >>>>> looked
> >> > >> >>>>>> at the Apache Tomcat docs
> >> > >> >>>>>>
> >(http://tomcat.apache.org/tomcat-5.5-doc/config/context.ht
> >> > >> >>>>>> ml) and
> >> > >> >>found
> >> > >> >>>>> that
> >> > >> >>>>>> crossContext uses the following
> >> > >> >>>>>>
> >> > >> >>>>>> Set to true if you want calls within this application to
> >> > >> >>>>>> ServletContext.getContext() to successfully return a
> >> > >> >>>>>> request
> >> > >> >>dispatcher
> >> > >> >>>>> for
> >> > >> >>>>>> other web applications running on this virtual host. Set
> >> > >> >>>>>> to false
> >> > >> >(the
> >> > >> >>>>>> default) in security conscious environments, to make
> >> > >> >>>>>> getContext()
> >> > >> >>>always
> >> > >> >>>>>> return null.
> >> > >> >>>>>>
> >> > >> >>>>>> It seems like the call is made internally through Tomcat
> >> > >> >>>>>> rather
> >> > >than
> >> > >> >a
> >> > >> >>>>> full
> >> > >> >>>>>> http call. I noticed the URL that OPS shows as receiving
> >> > >> >>>>>> is the
> >> > >URL
> >> > >> >>the
> >> > >> >>>>> call
> >> > >> >>>>>> is coming from and not the URL being called, also the
> >> > >> >>>>>> oxf:request
> >> > >> >>>>> processor
> >> > >> >>>>>> gives the request information for the calling
> >page, as if
> >> > >> >>>>>> it is
> >> > >> >>>>> forwarded.
> >> > >> >>>>>
> >> > >> >>>>> You can force OPS to not optimize local HTTP requests by
> >> > >> >>>>> setting a property to false in properties.xml:
> >> > >> >>>>>
> >> > >> >>>>> <property as="xs:boolean" name="oxf.xforms.optimize-local-
> >> > >submission"
> >> > >> >>>>>          value="false"/>
> >> > >> >>>>>
> >> > >> >>>>> Maybe this will help.
> >> > >> >>>>>
> >> > >> >>>>> -Erik
> >> > >> >>>>>
> >> > >> >>>>> --
> >> > >> >>>>> Orbeon - XForms Everywhere:
> >> > >> >>>>> http://www.orbeon.com/blog/
> >> > >> >>>>
> >> > >> >>>>
> >> > >> >>>>
> >> > >> >>>>
> >> > >> >>>>
> >------------------------------------------------------------
> >> > >> >>>> --------
> >> > >---
> >> > >> >-
> >> > >> >>>>
> >> > >> >>>>
> >> > >> >>>> --
> >> > >> >>>> You receive this message as a subscriber of the ops-
> >> > >[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
> >> > >> >>>
> >> > >> >>>
> >> > >> >>>--
> >> > >> >>>Orbeon - XForms Everywhere:
> >> > >> >>>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
> >> >
> >> >
> >> >
> >>
> >>
> >> --
> >> Blog (XML, Web apps, Open Source):
> >> http://www.orbeon.com/blog/
> >>
> >
> >
> >--
> >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: Problems call OPS from JSTL

Emiliano Marmonti
Hello everybody

Sorry by the question, but I'm trying to understand if actually Orbeon
could be used from JSTL. I've understood wrong or actually is not
working ok?

I'm looking for a way to integrate for an existing Struts application
an XForms implementation. I've tried using Orbeon as a filter but
perhaps from JSTL should be more comfortable, isn't it?

Thanks and regards
Emiliano.

On 7/26/06, Alessandro Vernet <[hidden email]> wrote:

> Hi Ryan,
>
> With a debugger, you can put a breakpoint in the 'service' method of
> 'OPSServlet'. There you can look at what you get a in the 'request'
> object, an in particular at what is returned by
> request.getRequestURI().
>
> Alex
>
> On 7/25/06, Ryan Puddephatt <[hidden email]> wrote:
> > Alex,
> >         Thanks for your help on this, I'll try and investigate it a little
> > more, see if there is a common way to handle this response. What java file
> > handles the request, in case I need to experiment?
> >
> > Ryan
> >
> > Ryan Puddephatt
> > Software Engineer
> >
> > Teleflex Group - IT UK
> > 1 Michaelson Square
> > Livingston
> > West Lothian
> > Scotland
> > EH54 7DP
> >
> > e> [hidden email]
> > t> +44(0)1506 407 110
> > f> +44(0)1506 407 108
> >
> >
> >
> > >-----Original Message-----
> > >From: [hidden email] [mailto:[hidden email]] On Behalf
> > >Of Alessandro Vernet
> > >Sent: 25 July 2006 02:25
> > >To: [hidden email]
> > >Subject: Re: [ops-users] Problems call OPS from JSTL
> > >
> > >Hi Ryan,
> > >
> > >To follow-up on this: I have posted a question on the tomcat
> > >users mailing list on Jul 12 which didn't get an answer so
> > >far. So it looks like this issue will stay open, as we depend
> > >on Tomcat for passing us the correct request URI, and I don't
> > >know what we can do in this case as it looks like we don't
> > >receive the correct request URI from Tomcat.
> > >
> > >Alex
> > >
> > >On 7/12/06, Alessandro Vernet <[hidden email]> wrote:
> > >> Ryan,
> > >>
> > >> The context object is only used on the caller side, that is the JSTL
> > >> side. In OPS we get a request, and from the request, we
> > >should be able
> > >> to get the requested URI with request.getRequestURI(). The
> > >problem is
> > >> that this call does not return the URI you specify in the c:import,
> > >> but the URI requested by your browser.
> > >>
> > >> I am not sure what to make of this, so I asked a question in the
> > >> tomcat-users list, and we'll see if I get a useful response.
> > >>
> > >> Alex
> > >>
> > >> On 7/11/06, Ryan Puddephatt <[hidden email]> wrote:
> > >> > Alex,
> > >> >         This won't work for me I'm afraid because we don't have
> > >> > direct access to our production machines so we can't amend
> > >the URL to suit this.
> > >> >
> > >> > Reading the tomcat configuration documentation
> > >> > (http://tomcat.apache.org/tomcat-5.5-doc/config/context.html) I
> > >> > noticed the crossContext property says this:
> > >> >
> > >> > Set to true if you want calls within this application to
> > >> > ServletContext.getContext() to successfully return a request
> > >> > dispatcher for other web applications running on this
> > >virtual host.
> > >> > Set to false (the
> > >> > default) in security conscious environments, to make getContext()
> > >> > always return null.
> > >> >
> > >> > I need the crossContext set to true for c:import/@context to
> > >> > function so maybe to problem lies with the use of the
> > >ServletContext object?
> > >> >
> > >> > Ryan
> > >> >
> > >> > Ryan Puddephatt
> > >> > Software Engineer
> > >> > TFX Group - IT UK
> > >> > 1 Michaelson Square
> > >> > Livingston
> > >> > West Lothian
> > >> > Scotand
> > >> > EH54 7DP
> > >> >
> > >> > * [hidden email]
> > >> > ( 01506 407 110
> > >> > 7  01506 407 108
> > >> >
> > >> > >-----Original Message-----
> > >> > >From: [hidden email] [mailto:[hidden email]] On Behalf Of
> > >> > >Alessandro Vernet
> > >> > >Sent: 11 July 2006 09:25
> > >> > >To: [hidden email]
> > >> > >Subject: Re: [ops-users] Problems call OPS from JSTL
> > >> > >
> > >> > >Hi Ryan,
> > >> > >
> > >> > >OPS returns a page not found, because calling methods like
> > >> > >request.getRequestURI() in this case apparently returns the
> > >> > >original URL, not the URL requested by the c:import. With Tomcat,
> > >> > >we can get from within the OPS servlet the path the request was
> > >> > >dispatched to
> > >> > >with:
> > >> > >
> > >> >
> > >>request.getAttribute("org.apache.catalina.core.DISPATCHER_REQUEST_P
> > >> > >ATH")
> > >> > >
> > >> > >I am surprised by this behavior, but it looks like a way
> > >around it
> > >> > >is to specify a full URL with no context in c:import, as in:
> > >> > >
> > >> > ><c:import var="tagXML"
> > >> > >url="http://localhost:8080/ops/xforms-controls"/>
> > >> > >
> > >> > >This seems to be working fine. Is this an acceptable
> > >solution in your case?
> > >> > >
> > >> > >Alex
> > >> > >
> > >> > >On 7/6/06, Ryan Puddephatt <[hidden email]> wrote:
> > >> > >> Erik/Alex,
> > >> > >>         Any joy with finding this problem when making a context
> > >> > >> call in
> > >> > >JSP?
> > >> > >>
> > >> > >> Thanks
> > >> > >>
> > >> > >> Ryan
> > >> > >>
> > >> > >> Ryan Puddephatt
> > >> > >> Software Engineer
> > >> > >> TFX Group - IT UK
> > >> > >> 1 Michaelson Square
> > >> > >> Livingston
> > >> > >> West Lothian
> > >> > >> Scotand
> > >> > >> EH54 7DP
> > >> > >>
> > >> > >> * [hidden email]
> > >> > >> ( 01506 407 110
> > >> > >> 7  01506 407 108
> > >> > >>
> > >> > >> >-----Original Message-----
> > >> > >> >From: Ryan Puddephatt [mailto:[hidden email]]
> > >> > >> >Sent: 05 June 2006 12:06
> > >> > >> >To: [hidden email]
> > >> > >> >Subject: RE: [ops-users] Problems call OPS from JSTL
> > >> > >> >
> > >> > >> >Erik,
> > >> > >> >       Any joy with this?
> > >> > >> >
> > >> > >> >Thanks Ryan
> > >> > >> >
> > >> > >> >Ryan Puddephatt
> > >> > >> >Software Engineer
> > >> > >> >TFX Group - IT UK
> > >> > >> >1 Michaelson Square
> > >> > >> >Livingston
> > >> > >> >West Lothian
> > >> > >> >Scotand
> > >> > >> >EH54 7DP
> > >> > >> >
> > >> > >> >* [hidden email]
> > >> > >> >( 01506 407 110
> > >> > >> >7  01506 407 108
> > >> > >> >
> > >> > >> >
> > >> > >> >>-----Original Message-----
> > >> > >> >>From: Ryan Puddephatt [mailto:[hidden email]]
> > >> > >> >>Sent: 16 May 2006 12:43
> > >> > >> >>To: [hidden email]
> > >> > >> >>Subject: RE: [ops-users] Problems call OPS from JSTL
> > >> > >> >>
> > >> > >> >>Erik,
> > >> > >> >>      Attached is jspapp.null I've had to rename it
> > >from zip as
> > >> > >> >>it
> > >> > >won't
> > >> > >> >>get past our email filters! For an OPS app you just need
> > >> > >> >>something that returns XML. Within the JSP app in file
> > >> > >> >>/jsp/index.jsp change
> > >> > ><c:import>
> > >> > >> >to
> > >> > >> >>the appropriate @context and @url.
> > >> > >> >>
> > >> > >> >>When loading the JSP page you will see that it
> > >returns the not
> > >> > >> >>found
> > >> > >page
> > >> > >> >>rather than the xml you wanted.
> > >> > >> >>
> > >> > >> >>Ryan
> > >> > >> >>
> > >> > >> >>Ryan Puddephatt
> > >> > >> >>Software Engineer
> > >> > >> >>TFX Group - IT UK
> > >> > >> >>1 Michaelson Square
> > >> > >> >>Livingston
> > >> > >> >>West Lothian
> > >> > >> >>Scotand
> > >> > >> >>EH54 7DP
> > >> > >> >>
> > >> > >> >>* [hidden email]
> > >> > >> >>( 01506 407 110
> > >> > >> >>7  01506 407 108
> > >> > >> >>
> > >> > >> >>>-----Original Message-----
> > >> > >> >>>From: Erik Bruchez [mailto:[hidden email]] On Behalf Of
> > >> > >> >>>Erik
> > >> > >Bruchez
> > >> > >> >>>Sent: 11 May 2006 23:48
> > >> > >> >>>To: [hidden email]
> > >> > >> >>>Subject: Re: [ops-users] Problems call OPS from JSTL
> > >> > >> >>>
> > >> > >> >>>Sure, that would help.
> > >> > >> >>>
> > >> > >> >>>-Erik
> > >> > >> >>>
> > >> > >> >>>Ryan Puddephatt wrote:
> > >> > >> >>>> Erik,
> > >> > >> >>>>    The problem still exists, even when I change this
> > >> > >> >>>> propertie,
> > >> > >would
> > >> > >> >>>> you like me to get a test case together, it will be a JSP
> > >> > >> >>>> and a OPS
> > >> > >> >app?
> > >> > >> >>>>
> > >> > >> >>>> Ryan
> > >> > >> >>>>
> > >> > >> >>>> Ryan Puddephatt
> > >> > >> >>>> Software Engineer
> > >> > >> >>>> TFX Group - IT UK
> > >> > >> >>>> 1 Michaelson Square
> > >> > >> >>>> Livingston
> > >> > >> >>>> West Lothian
> > >> > >> >>>> Scotand
> > >> > >> >>>> EH54 7DP
> > >> > >> >>>>
> > >> > >> >>>> * [hidden email]
> > >> > >> >>>> ( 01506 407 110
> > >> > >> >>>> 7  01506 407 108
> > >> > >> >>>>
> > >> > >> >>>>> -----Original Message-----
> > >> > >> >>>>> From: Erik Bruchez [mailto:[hidden email]] On
> > >Behalf Of
> > >> > >> >>>>> Erik
> > >> > >> >>Bruchez
> > >> > >> >>>>> Sent: 03 May 2006 19:37
> > >> > >> >>>>> To: [hidden email]
> > >> > >> >>>>> Subject: Re: [ops-users] Problems call OPS from JSTL
> > >> > >> >>>>>
> > >> > >> >>>>> Ryan Puddephatt wrote:
> > >> > >> >>>>>> Alex,
> > >> > >> >>>>>>  Any ideas as to what is causing this problem?
> > >I'm having
> > >> > >> >>>>>> to do
> > >> > >> >a
> > >> > >> >>>>>> major hack to catch a 404 at the moment and I'd
> > >rather tidy it up!
> > >> > >I
> > >> > >> >>>>> looked
> > >> > >> >>>>>> at the Apache Tomcat docs
> > >> > >> >>>>>>
> > >(http://tomcat.apache.org/tomcat-5.5-doc/config/context.ht
> > >> > >> >>>>>> ml) and
> > >> > >> >>found
> > >> > >> >>>>> that
> > >> > >> >>>>>> crossContext uses the following
> > >> > >> >>>>>>
> > >> > >> >>>>>> Set to true if you want calls within this application to
> > >> > >> >>>>>> ServletContext.getContext() to successfully return a
> > >> > >> >>>>>> request
> > >> > >> >>dispatcher
> > >> > >> >>>>> for
> > >> > >> >>>>>> other web applications running on this virtual host. Set
> > >> > >> >>>>>> to false
> > >> > >> >(the
> > >> > >> >>>>>> default) in security conscious environments, to make
> > >> > >> >>>>>> getContext()
> > >> > >> >>>always
> > >> > >> >>>>>> return null.
> > >> > >> >>>>>>
> > >> > >> >>>>>> It seems like the call is made internally through Tomcat
> > >> > >> >>>>>> rather
> > >> > >than
> > >> > >> >a
> > >> > >> >>>>> full
> > >> > >> >>>>>> http call. I noticed the URL that OPS shows as receiving
> > >> > >> >>>>>> is the
> > >> > >URL
> > >> > >> >>the
> > >> > >> >>>>> call
> > >> > >> >>>>>> is coming from and not the URL being called, also the
> > >> > >> >>>>>> oxf:request
> > >> > >> >>>>> processor
> > >> > >> >>>>>> gives the request information for the calling
> > >page, as if
> > >> > >> >>>>>> it is
> > >> > >> >>>>> forwarded.
> > >> > >> >>>>>
> > >> > >> >>>>> You can force OPS to not optimize local HTTP requests by
> > >> > >> >>>>> setting a property to false in properties.xml:
> > >> > >> >>>>>
> > >> > >> >>>>> <property as="xs:boolean" name="oxf.xforms.optimize-local-
> > >> > >submission"
> > >> > >> >>>>>          value="false"/>
> > >> > >> >>>>>
> > >> > >> >>>>> Maybe this will help.
> > >> > >> >>>>>
> > >> > >> >>>>> -Erik
> > >> > >> >>>>>
> > >> > >> >>>>> --
> > >> > >> >>>>> Orbeon - XForms Everywhere:
> > >> > >> >>>>> http://www.orbeon.com/blog/
> > >> > >> >>>>
> > >> > >> >>>>
> > >> > >> >>>>
> > >> > >> >>>>
> > >> > >> >>>>
> > >------------------------------------------------------------
> > >> > >> >>>> --------
> > >> > >---
> > >> > >> >-
> > >> > >> >>>>
> > >> > >> >>>>
> > >> > >> >>>> --
> > >> > >> >>>> You receive this message as a subscriber of the ops-
> > >> > >[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
> > >> > >> >>>
> > >> > >> >>>
> > >> > >> >>>--
> > >> > >> >>>Orbeon - XForms Everywhere:
> > >> > >> >>>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
> > >> >
> > >> >
> > >> >
> > >>
> > >>
> > >> --
> > >> Blog (XML, Web apps, Open Source):
> > >> http://www.orbeon.com/blog/
> > >>
> > >
> > >
> > >--
> > >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
>
>
>


--
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: Problems call OPS from JSTL

Alessandro  Vernet
Administrator
Hi Emiliano,

It looks like you are doing the right thing: if your application is
using Struts and JSTL, you generate XForms in your JSP files, and
setup PresentationServer as a filter.

If you don't need to use JSP files anymore, we recommend you use
PresentationServer as a servlet and place your XHTML+XForms files in
the resources, which is even better for performance as this will allow
PresentationServer to caching more aggressively your XForms.

Alex

On 7/26/06, Emiliano Marmonti <[hidden email]> wrote:

> Hello everybody
>
> Sorry by the question, but I'm trying to understand if actually Orbeon
> could be used from JSTL. I've understood wrong or actually is not
> working ok?
>
> I'm looking for a way to integrate for an existing Struts application
> an XForms implementation. I've tried using Orbeon as a filter but
> perhaps from JSTL should be more comfortable, isn't it?
>
> Thanks and regards
> Emiliano.
>
> On 7/26/06, Alessandro Vernet <[hidden email]> wrote:
> > Hi Ryan,
> >
> > With a debugger, you can put a breakpoint in the 'service' method of
> > 'OPSServlet'. There you can look at what you get a in the 'request'
> > object, an in particular at what is returned by
> > request.getRequestURI().
> >
> > Alex
> >
> > On 7/25/06, Ryan Puddephatt <[hidden email]> wrote:
> > > Alex,
> > >         Thanks for your help on this, I'll try and investigate it a little
> > > more, see if there is a common way to handle this response. What java file
> > > handles the request, in case I need to experiment?
> > >
> > > Ryan
> > >
> > > Ryan Puddephatt
> > > Software Engineer
> > >
> > > Teleflex Group - IT UK
> > > 1 Michaelson Square
> > > Livingston
> > > West Lothian
> > > Scotland
> > > EH54 7DP
> > >
> > > e> [hidden email]
> > > t> +44(0)1506 407 110
> > > f> +44(0)1506 407 108
> > >
> > >
> > >
> > > >-----Original Message-----
> > > >From: [hidden email] [mailto:[hidden email]] On Behalf
> > > >Of Alessandro Vernet
> > > >Sent: 25 July 2006 02:25
> > > >To: [hidden email]
> > > >Subject: Re: [ops-users] Problems call OPS from JSTL
> > > >
> > > >Hi Ryan,
> > > >
> > > >To follow-up on this: I have posted a question on the tomcat
> > > >users mailing list on Jul 12 which didn't get an answer so
> > > >far. So it looks like this issue will stay open, as we depend
> > > >on Tomcat for passing us the correct request URI, and I don't
> > > >know what we can do in this case as it looks like we don't
> > > >receive the correct request URI from Tomcat.
> > > >
> > > >Alex
> > > >
> > > >On 7/12/06, Alessandro Vernet <[hidden email]> wrote:
> > > >> Ryan,
> > > >>
> > > >> The context object is only used on the caller side, that is the JSTL
> > > >> side. In OPS we get a request, and from the request, we
> > > >should be able
> > > >> to get the requested URI with request.getRequestURI(). The
> > > >problem is
> > > >> that this call does not return the URI you specify in the c:import,
> > > >> but the URI requested by your browser.
> > > >>
> > > >> I am not sure what to make of this, so I asked a question in the
> > > >> tomcat-users list, and we'll see if I get a useful response.
> > > >>
> > > >> Alex
> > > >>
> > > >> On 7/11/06, Ryan Puddephatt <[hidden email]> wrote:
> > > >> > Alex,
> > > >> >         This won't work for me I'm afraid because we don't have
> > > >> > direct access to our production machines so we can't amend
> > > >the URL to suit this.
> > > >> >
> > > >> > Reading the tomcat configuration documentation
> > > >> > (http://tomcat.apache.org/tomcat-5.5-doc/config/context.html) I
> > > >> > noticed the crossContext property says this:
> > > >> >
> > > >> > Set to true if you want calls within this application to
> > > >> > ServletContext.getContext() to successfully return a request
> > > >> > dispatcher for other web applications running on this
> > > >virtual host.
> > > >> > Set to false (the
> > > >> > default) in security conscious environments, to make getContext()
> > > >> > always return null.
> > > >> >
> > > >> > I need the crossContext set to true for c:import/@context to
> > > >> > function so maybe to problem lies with the use of the
> > > >ServletContext object?
> > > >> >
> > > >> > Ryan
> > > >> >
> > > >> > Ryan Puddephatt
> > > >> > Software Engineer
> > > >> > TFX Group - IT UK
> > > >> > 1 Michaelson Square
> > > >> > Livingston
> > > >> > West Lothian
> > > >> > Scotand
> > > >> > EH54 7DP
> > > >> >
> > > >> > * [hidden email]
> > > >> > ( 01506 407 110
> > > >> > 7  01506 407 108
> > > >> >
> > > >> > >-----Original Message-----
> > > >> > >From: [hidden email] [mailto:[hidden email]] On Behalf Of
> > > >> > >Alessandro Vernet
> > > >> > >Sent: 11 July 2006 09:25
> > > >> > >To: [hidden email]
> > > >> > >Subject: Re: [ops-users] Problems call OPS from JSTL
> > > >> > >
> > > >> > >Hi Ryan,
> > > >> > >
> > > >> > >OPS returns a page not found, because calling methods like
> > > >> > >request.getRequestURI() in this case apparently returns the
> > > >> > >original URL, not the URL requested by the c:import. With Tomcat,
> > > >> > >we can get from within the OPS servlet the path the request was
> > > >> > >dispatched to
> > > >> > >with:
> > > >> > >
> > > >> >
> > > >>request.getAttribute("org.apache.catalina.core.DISPATCHER_REQUEST_P
> > > >> > >ATH")
> > > >> > >
> > > >> > >I am surprised by this behavior, but it looks like a way
> > > >around it
> > > >> > >is to specify a full URL with no context in c:import, as in:
> > > >> > >
> > > >> > ><c:import var="tagXML"
> > > >> > >url="http://localhost:8080/ops/xforms-controls"/>
> > > >> > >
> > > >> > >This seems to be working fine. Is this an acceptable
> > > >solution in your case?
> > > >> > >
> > > >> > >Alex
> > > >> > >
> > > >> > >On 7/6/06, Ryan Puddephatt <[hidden email]> wrote:
> > > >> > >> Erik/Alex,
> > > >> > >>         Any joy with finding this problem when making a context
> > > >> > >> call in
> > > >> > >JSP?
> > > >> > >>
> > > >> > >> Thanks
> > > >> > >>
> > > >> > >> Ryan
> > > >> > >>
> > > >> > >> Ryan Puddephatt
> > > >> > >> Software Engineer
> > > >> > >> TFX Group - IT UK
> > > >> > >> 1 Michaelson Square
> > > >> > >> Livingston
> > > >> > >> West Lothian
> > > >> > >> Scotand
> > > >> > >> EH54 7DP
> > > >> > >>
> > > >> > >> * [hidden email]
> > > >> > >> ( 01506 407 110
> > > >> > >> 7  01506 407 108
> > > >> > >>
> > > >> > >> >-----Original Message-----
> > > >> > >> >From: Ryan Puddephatt [mailto:[hidden email]]
> > > >> > >> >Sent: 05 June 2006 12:06
> > > >> > >> >To: [hidden email]
> > > >> > >> >Subject: RE: [ops-users] Problems call OPS from JSTL
> > > >> > >> >
> > > >> > >> >Erik,
> > > >> > >> >       Any joy with this?
> > > >> > >> >
> > > >> > >> >Thanks Ryan
> > > >> > >> >
> > > >> > >> >Ryan Puddephatt
> > > >> > >> >Software Engineer
> > > >> > >> >TFX Group - IT UK
> > > >> > >> >1 Michaelson Square
> > > >> > >> >Livingston
> > > >> > >> >West Lothian
> > > >> > >> >Scotand
> > > >> > >> >EH54 7DP
> > > >> > >> >
> > > >> > >> >* [hidden email]
> > > >> > >> >( 01506 407 110
> > > >> > >> >7  01506 407 108
> > > >> > >> >
> > > >> > >> >
> > > >> > >> >>-----Original Message-----
> > > >> > >> >>From: Ryan Puddephatt [mailto:[hidden email]]
> > > >> > >> >>Sent: 16 May 2006 12:43
> > > >> > >> >>To: [hidden email]
> > > >> > >> >>Subject: RE: [ops-users] Problems call OPS from JSTL
> > > >> > >> >>
> > > >> > >> >>Erik,
> > > >> > >> >>      Attached is jspapp.null I've had to rename it
> > > >from zip as
> > > >> > >> >>it
> > > >> > >won't
> > > >> > >> >>get past our email filters! For an OPS app you just need
> > > >> > >> >>something that returns XML. Within the JSP app in file
> > > >> > >> >>/jsp/index.jsp change
> > > >> > ><c:import>
> > > >> > >> >to
> > > >> > >> >>the appropriate @context and @url.
> > > >> > >> >>
> > > >> > >> >>When loading the JSP page you will see that it
> > > >returns the not
> > > >> > >> >>found
> > > >> > >page
> > > >> > >> >>rather than the xml you wanted.
> > > >> > >> >>
> > > >> > >> >>Ryan
> > > >> > >> >>
> > > >> > >> >>Ryan Puddephatt
> > > >> > >> >>Software Engineer
> > > >> > >> >>TFX Group - IT UK
> > > >> > >> >>1 Michaelson Square
> > > >> > >> >>Livingston
> > > >> > >> >>West Lothian
> > > >> > >> >>Scotand
> > > >> > >> >>EH54 7DP
> > > >> > >> >>
> > > >> > >> >>* [hidden email]
> > > >> > >> >>( 01506 407 110
> > > >> > >> >>7  01506 407 108
> > > >> > >> >>
> > > >> > >> >>>-----Original Message-----
> > > >> > >> >>>From: Erik Bruchez [mailto:[hidden email]] On Behalf Of
> > > >> > >> >>>Erik
> > > >> > >Bruchez
> > > >> > >> >>>Sent: 11 May 2006 23:48
> > > >> > >> >>>To: [hidden email]
> > > >> > >> >>>Subject: Re: [ops-users] Problems call OPS from JSTL
> > > >> > >> >>>
> > > >> > >> >>>Sure, that would help.
> > > >> > >> >>>
> > > >> > >> >>>-Erik
> > > >> > >> >>>
> > > >> > >> >>>Ryan Puddephatt wrote:
> > > >> > >> >>>> Erik,
> > > >> > >> >>>>    The problem still exists, even when I change this
> > > >> > >> >>>> propertie,
> > > >> > >would
> > > >> > >> >>>> you like me to get a test case together, it will be a JSP
> > > >> > >> >>>> and a OPS
> > > >> > >> >app?
> > > >> > >> >>>>
> > > >> > >> >>>> Ryan
> > > >> > >> >>>>
> > > >> > >> >>>> Ryan Puddephatt
> > > >> > >> >>>> Software Engineer
> > > >> > >> >>>> TFX Group - IT UK
> > > >> > >> >>>> 1 Michaelson Square
> > > >> > >> >>>> Livingston
> > > >> > >> >>>> West Lothian
> > > >> > >> >>>> Scotand
> > > >> > >> >>>> EH54 7DP
> > > >> > >> >>>>
> > > >> > >> >>>> * [hidden email]
> > > >> > >> >>>> ( 01506 407 110
> > > >> > >> >>>> 7  01506 407 108
> > > >> > >> >>>>
> > > >> > >> >>>>> -----Original Message-----
> > > >> > >> >>>>> From: Erik Bruchez [mailto:[hidden email]] On
> > > >Behalf Of
> > > >> > >> >>>>> Erik
> > > >> > >> >>Bruchez
> > > >> > >> >>>>> Sent: 03 May 2006 19:37
> > > >> > >> >>>>> To: [hidden email]
> > > >> > >> >>>>> Subject: Re: [ops-users] Problems call OPS from JSTL
> > > >> > >> >>>>>
> > > >> > >> >>>>> Ryan Puddephatt wrote:
> > > >> > >> >>>>>> Alex,
> > > >> > >> >>>>>>  Any ideas as to what is causing this problem?
> > > >I'm having
> > > >> > >> >>>>>> to do
> > > >> > >> >a
> > > >> > >> >>>>>> major hack to catch a 404 at the moment and I'd
> > > >rather tidy it up!
> > > >> > >I
> > > >> > >> >>>>> looked
> > > >> > >> >>>>>> at the Apache Tomcat docs
> > > >> > >> >>>>>>
> > > >(http://tomcat.apache.org/tomcat-5.5-doc/config/context.ht
> > > >> > >> >>>>>> ml) and
> > > >> > >> >>found
> > > >> > >> >>>>> that
> > > >> > >> >>>>>> crossContext uses the following
> > > >> > >> >>>>>>
> > > >> > >> >>>>>> Set to true if you want calls within this application to
> > > >> > >> >>>>>> ServletContext.getContext() to successfully return a
> > > >> > >> >>>>>> request
> > > >> > >> >>dispatcher
> > > >> > >> >>>>> for
> > > >> > >> >>>>>> other web applications running on this virtual host. Set
> > > >> > >> >>>>>> to false
> > > >> > >> >(the
> > > >> > >> >>>>>> default) in security conscious environments, to make
> > > >> > >> >>>>>> getContext()
> > > >> > >> >>>always
> > > >> > >> >>>>>> return null.
> > > >> > >> >>>>>>
> > > >> > >> >>>>>> It seems like the call is made internally through Tomcat
> > > >> > >> >>>>>> rather
> > > >> > >than
> > > >> > >> >a
> > > >> > >> >>>>> full
> > > >> > >> >>>>>> http call. I noticed the URL that OPS shows as receiving
> > > >> > >> >>>>>> is the
> > > >> > >URL
> > > >> > >> >>the
> > > >> > >> >>>>> call
> > > >> > >> >>>>>> is coming from and not the URL being called, also the
> > > >> > >> >>>>>> oxf:request
> > > >> > >> >>>>> processor
> > > >> > >> >>>>>> gives the request information for the calling
> > > >page, as if
> > > >> > >> >>>>>> it is
> > > >> > >> >>>>> forwarded.
> > > >> > >> >>>>>
> > > >> > >> >>>>> You can force OPS to not optimize local HTTP requests by
> > > >> > >> >>>>> setting a property to false in properties.xml:
> > > >> > >> >>>>>
> > > >> > >> >>>>> <property as="xs:boolean" name="oxf.xforms.optimize-local-
> > > >> > >submission"
> > > >> > >> >>>>>          value="false"/>
> > > >> > >> >>>>>
> > > >> > >> >>>>> Maybe this will help.
> > > >> > >> >>>>>
> > > >> > >> >>>>> -Erik
> > > >> > >> >>>>>
> > > >> > >> >>>>> --
> > > >> > >> >>>>> Orbeon - XForms Everywhere:
> > > >> > >> >>>>> http://www.orbeon.com/blog/
> > > >> > >> >>>>
> > > >> > >> >>>>
> > > >> > >> >>>>
> > > >> > >> >>>>
> > > >> > >> >>>>
> > > >------------------------------------------------------------
> > > >> > >> >>>> --------
> > > >> > >---
> > > >> > >> >-
> > > >> > >> >>>>
> > > >> > >> >>>>
> > > >> > >> >>>> --
> > > >> > >> >>>> You receive this message as a subscriber of the ops-
> > > >> > >[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
> > > >> > >> >>>
> > > >> > >> >>>
> > > >> > >> >>>--
> > > >> > >> >>>Orbeon - XForms Everywhere:
> > > >> > >> >>>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
> > > >> >
> > > >> >
> > > >> >
> > > >>
> > > >>
> > > >> --
> > > >> Blog (XML, Web apps, Open Source):
> > > >> http://www.orbeon.com/blog/
> > > >>
> > > >
> > > >
> > > >--
> > > >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
> >
> >
> >
>
>
>
>
> --
> 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
12