Skip to main content



      Home
Home » Eclipse Projects » Equinox » How to forward a request through the equinox bridge to OSGi
How to forward a request through the equinox bridge to OSGi [message #86399] Mon, 09 April 2007 17:42 Go to next message
Eclipse UserFriend
Originally posted by: lsyang.us.ibm.com

Hi,

I got the equinox bridge running in both Tomcat and WAS. I am wondering
how the equinox bridge accepts request. Is it possible get it work in
the follow senario:

Servlet A running in Tomcat,
Servlet B running in OSGi,
Plugin C running in OSGi,
Servlet A get a request. Can the servlet A forward the request to
servlet B through the equinox bridge?
Servlet A get a request. Can the servlet A forward the request to plugin
C through the equinox bridge?

Any suggestion or sample code would be greatly appreciated!

Susan
Re: How to forward a request through the equinox bridge to OSGi [message #86443 is a reply to message #86399] Mon, 09 April 2007 23:06 Go to previous messageGo to next message
Eclipse UserFriend
Hi Susan,

In general the servletbridge accepts requests by path/URL.

What this means for your specific examples is that to forward a request from
Servlet A to Servlet B you could fetch a RequestDispatcher and send a
request to the path associated with Servlet B inside the bridge.

The second use case where (if I'm understanding correctly) you have Servlet
A trying to directly use functionality in an arbitrary is not directly
supported by the servletbridge as it only supports interaction via the
Servlet API. You could create your own custom bridge to do this sort of
communication (some have done -- search the newsgroup archives) however
that's a fair bit of work so I'd be a bit cautious for this use-case until
you fully understood what's involved.

HTH
-Simon


"Susan Diamond" <lsyang@us.ibm.com> wrote in message
news:evebvl$ca5$1@build.eclipse.org...
> Hi,
>
> I got the equinox bridge running in both Tomcat and WAS. I am wondering
> how the equinox bridge accepts request. Is it possible get it work in the
> follow senario:
>
> Servlet A running in Tomcat,
> Servlet B running in OSGi,
> Plugin C running in OSGi,
> Servlet A get a request. Can the servlet A forward the request to servlet
> B through the equinox bridge?
> Servlet A get a request. Can the servlet A forward the request to plugin C
> through the equinox bridge?
>
> Any suggestion or sample code would be greatly appreciated!
>
> Susan
Re: How to forward a request through the equinox bridge to OSGi [message #86542 is a reply to message #86443] Wed, 11 April 2007 14:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lsyang.us.ibm.com

Simon Kaegi wrote:

> Hi Susan,
>
> In general the servletbridge accepts requests by path/URL.
>
> What this means for your specific examples is that to forward a request from
> Servlet A to Servlet B you could fetch a RequestDispatcher and send a
> request to the path associated with Servlet B inside the bridge.
>
> The second use case where (if I'm understanding correctly) you have Servlet
> A trying to directly use functionality in an arbitrary is not directly
> supported by the servletbridge as it only supports interaction via the
> Servlet API. You could create your own custom bridge to do this sort of
> communication (some have done -- search the newsgroup archives) however
> that's a fair bit of work so I'd be a bit cautious for this use-case until
> you fully understood what's involved.
>
> HTH
> -Simon
>
>
> "Susan Diamond" <lsyang@us.ibm.com> wrote in message
> news:evebvl$ca5$1@build.eclipse.org...
>
>>Hi,
>>
>>I got the equinox bridge running in both Tomcat and WAS. I am wondering
>>how the equinox bridge accepts request. Is it possible get it work in the
>>follow senario:
>>
>>Servlet A running in Tomcat,
>>Servlet B running in OSGi,
>>Plugin C running in OSGi,
>>Servlet A get a request. Can the servlet A forward the request to servlet
>>B through the equinox bridge?
>>Servlet A get a request. Can the servlet A forward the request to plugin C
>>through the equinox bridge?
>>
>>Any suggestion or sample code would be greatly appreciated!
>>
>>Susan
>
>
>

Hi Simon,

Thank you for your reply.

I decided to use the first use case. I did some prototype. However,
RequestDispatcher only works when servlet A and servlet B are in the
same WAR. In my case, servlet A is in WAR_A, servlet B is inside the
bridge WAR in OSGi. Do you have any suggestion on how to forward request
and response from one WAR to another WAR?

Susan
Re: How to forward a request through the equinox bridge to OSGi [message #86557 is a reply to message #86542] Wed, 11 April 2007 14:53 Go to previous message
Eclipse UserFriend
If you want to do inter-WAR RequestDispatching you first have to get the
other WARs context.
e.g. ServletContext.getContext("other")

....and then use that context to do your request dispatching

-Simon

"Susan Diamond" <lsyang@us.ibm.com> wrote in message
news:evj8d5$7q8$1@build.eclipse.org...
> Simon Kaegi wrote:
>
>> Hi Susan,
>>
>> In general the servletbridge accepts requests by path/URL.
>>
>> What this means for your specific examples is that to forward a request
>> from Servlet A to Servlet B you could fetch a RequestDispatcher and send
>> a request to the path associated with Servlet B inside the bridge.
>>
>> The second use case where (if I'm understanding correctly) you have
>> Servlet A trying to directly use functionality in an arbitrary is not
>> directly supported by the servletbridge as it only supports interaction
>> via the Servlet API. You could create your own custom bridge to do this
>> sort of communication (some have done -- search the newsgroup archives)
>> however that's a fair bit of work so I'd be a bit cautious for this
>> use-case until you fully understood what's involved.
>>
>> HTH
>> -Simon
>>
>>
>> "Susan Diamond" <lsyang@us.ibm.com> wrote in message
>> news:evebvl$ca5$1@build.eclipse.org...
>>
>>>Hi,
>>>
>>>I got the equinox bridge running in both Tomcat and WAS. I am wondering
>>>how the equinox bridge accepts request. Is it possible get it work in the
>>>follow senario:
>>>
>>>Servlet A running in Tomcat,
>>>Servlet B running in OSGi,
>>>Plugin C running in OSGi,
>>>Servlet A get a request. Can the servlet A forward the request to servlet
>>>B through the equinox bridge?
>>>Servlet A get a request. Can the servlet A forward the request to plugin
>>>C through the equinox bridge?
>>>
>>>Any suggestion or sample code would be greatly appreciated!
>>>
>>>Susan
>>
>>
>>
>
> Hi Simon,
>
> Thank you for your reply.
>
> I decided to use the first use case. I did some prototype. However,
> RequestDispatcher only works when servlet A and servlet B are in the same
> WAR. In my case, servlet A is in WAR_A, servlet B is inside the bridge WAR
> in OSGi. Do you have any suggestion on how to forward request and response
> from one WAR to another WAR?
>
> Susan
Previous Topic:Buddy Policy Question
Next Topic:ExtensionTracker
Goto Forum:
  


Current Time: Sat May 10 23:08:19 EDT 2025

Powered by FUDForum. Page generated in 0.03063 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top