Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] RequestDispatcher with a resource from a different OSGi bundle

So there are two things wrong as far as I can see:

*) Bug #453801 [1] (which I just entered)
*) The documentation says the "war" property should be:

    props.put("Jetty-WarResourcePath",".");

    but it must be:

        props.put ( "Jetty-WarFolderPath", "." );

Jens

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=453801

On 12/01/2014 06:03 PM, Jens Reimann wrote:
> Ok,
>
> I tried to solve this by deploying by registering a WebAppContext
> service. As described here [1].
>
> However this sample seems not to work. Although I can see that the
> service is registered
>
> -----------
>   Id=77, Status=ACTIVE      Data
> Root=/home/jens/Development/workspace_opm/.metadata/.plugins/org.eclipse.pde.core/Jetty1/org.eclipse.osgi/77/data
>   "Registered Services"
>    
> {org.eclipse.jetty.server.handler.ContextHandler}={contextPath=/test,
> Jetty-WarResourcePath=., service.id=62, service.bundleid=77,
> service.scope=singleton}
>   No services in use.
>   No exported packages
> -----------
>
> Jetty will not pick it up and only reports "not found". Also the log
> seem pretty quiet, instead of trying and initializing something.
>
> So you have any working setup for deploying a WebAppContext as a service?
>
> Thanks
>
> Jens
>
> [1]
> https://www.eclipse.org/jetty/documentation/current/framework-jetty-osgi.html#services-as-webapps
>
>
>
> On 12/01/2014 05:04 PM, Jens Reimann wrote:
>> Hi,
>>
>> I do have an OSGi setup with Jetty and Eclipse Equinox.
>>
>> Now at some point I want to dispatch requests to different bundles. I
>> have one Dispatcher servlet (defined using web.xml), dispatching calls
>> to different services, registered within OSGi. Now each service should
>> provide its view using JSP, located in it own bundle.
>>
>> So I am trying to forward/include the request to that bundle:
>>
>> -----------------
>> RequestDispatcher rd = request.getRequestDispatcher ( path );
>> rd.include ( request, response );
>> -----------------
>>
>> Now path is something like "/WEB-INF/views/test.jsp" for the moment.
>> However, this file should be coming from a different bundle, than the
>> bundle which hosts or defined the servlet. So I was thinking about
>> something like "platform:/bundle.symbolic.name/WEB-INF/views/test.jsp",
>> which does not work ;-)
>>
>> Is there any way to do this with Jetty?
>>
>> Thanks in advance
>>
>> Jens
>> _______________________________________________
>> jetty-dev mailing list
>> jetty-dev@xxxxxxxxxxx
>> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
>> https://dev.eclipse.org/mailman/listinfo/jetty-dev
>


-- 
IBH SYSTEMS GmbH
D-85235 Pfaffenhofen an der Glonn
Läutenring 43
Geschäftsführer / CEO: Dr. Thomas Heitzig

Amtsgericht München
Handelsregister Nummer  HRB 197959
USt ID: DE267945175

Office Munich
D 80992 München
Agnes-Pockels-Bogen 1
T +49 89 18 9 17 49 0

The information transmitted is intended only for the person or entity
to which it is addressed and may contain confidential and/or pivileged
material. Any review, retransmission, dissemination or other use of,
or taking of any action in reliance upon, this information by persons
or entities other than the intended recipient is prohibited. If you
received this in error, please contact the sender and delete the
material from any computer.



Back to the top