You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Qbyte Consulting <qb...@gmail.com> on 2016/08/01 10:27:04 UTC

Tapestry launch a JEE 7 webservice?

I am attempting to combine a JPA layer built on Tapestry 5.3.6 with a
RESTful webservice built for JEE 7.

The web service is configured in code:
public class ApplicationConfig extends Application

However Tapestry JPA is configured with the servlet filter in web.xml:
org.apache.tapestry5.TapestryFilter

I'm actually wanting to deploy on Jetty and not use a JEE container. How
can I combine these 2 approaches?

Is there are way to get my AppModule to get Tapestry to serve the web
services?

thanks,
John

Re: Tapestry launch a JEE 7 webservice?

Posted by Kalle Korhonen <ka...@gmail.com>.
Yes, use tapestry-resteasy (http://www.tynamo.org/tapestry-resteasy+guide/).
You wouldn't need an explicit subclass of Application, but you'd configure
your resources with:

    @Contribute(javax.ws.rs.core.Application.class)
    public static void configureRestResources(Configuration<Object>
singletons,
        YourRestResource yourRestResource, ... ) {
        singletons.add(yourRestResource);
        // optionally... CorsFeature implements javax.ws.rs.core.Feature
etc.
        singletons.add(new corsFeature());
        singletons.add(new JacksonConfig());
        singletons.add(new JsonExceptionMapper());
    }

Kalle


On Mon, Aug 1, 2016 at 3:27 AM, Qbyte Consulting <qb...@gmail.com>
wrote:

> I am attempting to combine a JPA layer built on Tapestry 5.3.6 with a
> RESTful webservice built for JEE 7.
>
> The web service is configured in code:
> public class ApplicationConfig extends Application
>
> However Tapestry JPA is configured with the servlet filter in web.xml:
> org.apache.tapestry5.TapestryFilter
>
> I'm actually wanting to deploy on Jetty and not use a JEE container. How
> can I combine these 2 approaches?
>
> Is there are way to get my AppModule to get Tapestry to serve the web
> services?
>
> thanks,
> John
>