tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: JAX-RS Arraylist RequestDispatcherProvider
Date Thu, 02 Feb 2017 15:18:02 GMT
2017-02-02 16:05 GMT+01:00 semanticfire <bart@netage.nl>:

> What I'm looking for is a way to do something like this:
>
> <Service id="dispatcher"
> class-name="org.apache.cxf.jaxrs.provider.RequestDispatcherProvider">
> classResources = java.util.ArrayList<MyClass>
> </Service>
>
> Which fails for XML notation.
>
>
Sure, this doesnt match any supported syntax but classresources is a
map<string, string> so previous syntax works


> is there a way to in CXF to mimic the viewable concept of jersey?
> that per class->method you can determine which JSP is used ?
>
>
per method i doubt but per type yes. That said it is not that hard to
implement it using a custom MessageBodyWriter and model. You can have a
look to this sample https://github.com/rmannibucau/jaxrs-mvc. For jsp it is
easier since you just redirect to the view you want after having filled the
request attributes.


>
>
> Romain Manni-Bucau wrote
> > Hi
> >
> > did you try something like
> > <Service id="dispatcher"
> > class-name="org.apache.cxf.jaxrs.provider.RequestDispatcherProvider">
> > classResources = \
> >      a=b\
> >      c=d
> > </Service>
> >
> >
> >
> > Romain Manni-Bucau
> > @rmannibucau &lt;https://twitter.com/rmannibucau&gt; |  Blog
> > &lt;https://blog-rmannibucau.rhcloud.com&gt; | Old Blog
> > &lt;http://rmannibucau.wordpress.com&gt; | Github
> > &lt;https://github.com/rmannibucau&gt; |
> > LinkedIn &lt;https://www.linkedin.com/in/rmannibucau&gt; | JavaEE
> Factory
> > &lt;https://javaeefactory-rmannibucau.rhcloud.com&gt;
> >
> > 2017-02-02 5:34 GMT+01:00 Bart van Leeuwen &lt;
>
> > bart_van_leeuwen@
>
> > &gt;:
> >
> >> Hi,
> >>
> >> I've played around with using RequestDispatcherProvider through
> >> resources.xml to map @GET to a JSP
> >> all works fine for single object, but when returing a
> >> java.util.ArrayList
> > <MyClass>
> >  I can only map the java.utilArrayList which
> >> means I can only use one arraylist
> >>
> >> I now have the following snippet in my resources.xml
> >>
> > <Service id="classResources" class-name="org.apache.
> >>
> >  openejb.config.sys.MapFactory">
> >>   java.util.ArrayList=/test.jsp
> >>
> > </Service>
> >>
> >> I resulted in extending java.util.ArrayList to have a unique classname,
> >> is
> >> that the way to solve this ?
> >>
> >> Met Vriendelijke Groet / With Kind Regards
> >> Bart van Leeuwen
> >>
> >>
> >> twitter: @semanticfire
> >> tel. +31(0)6-53182997
> >> Netage B.V.
> >> http://netage.nl
> >> Esdoornstraat 3
> >> 3461ER Linschoten
> >> The Netherlands
> >>
>
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/JAX-RS-Arraylist-RequestDispatcherProvider-
> tp4680997p4680999.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message