Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 20 Next »

Version status: 0.3.0 stable - used in production


Uses RestEASY 2.3.0.GA and Tapestry 5.3.x

for older versions check the version table


User guide for Tapestry-resteasy module

tapestry-resteasy provides integration with Tapestry 5 and JBoss' RESTEasy, an implementation JAX-RS (Java API for RESTful Web Services). JAX-RS is a very nice little spec and if you know what it is about, the following should be very easy to understand. Otherwise, read up on it at Jersey's overview (the reference implementation) or the actual specification. JBoss' RESTEasy provides a few more features over the reference implementation.


Add the tapestry-resteasy dependency to your pom.xml

To use tapestry-resteasy (an independent module of Tynamo), you need to add the following dependency to your pom.xml:

No need to edit your web.xml.

tapestry-resteasy integrates with the Tapestry's HttpServletRequest pipeline.

Create a package named "rest" for your rest services.

tapestry-resteasy will scan the "rest" package and automatically add singleton resources to the configuration.

If you want to add extra packages, besides InternalConstants.TAPESTRY_APP_PACKAGE_PARAM + ".rest", to be scanned for annotated REST resource classes you can contribute your package names to the ResteasyPackageManager.

Code your singleton resource.

Good practices:

  • Name the resource class using the entity name followed by the word "Resource".
  • The @Path should be the entity name in lowercase.

Annotate your entities.

Don't forget to annotate your entities with JAXB annotations. You need at least @XmlRootElement. See:

Add a provider library to your pom.xml


By default tapestry-resteasy does not includes any marshaller/unmarshaller dependency.
You will need to manually add the dependency to your pom.xml

The previous examples use a JSON marshaller/unmarshaller provided by the resteasy-jettison-provider library.

Contribute singleton resources

If the rest services autodiscovery is not enough for you, you can manually contribute singleton resources in your AppModule:


Since the upgrade to Tapestry 5.3 and the move from Javassist to Plastic your JAX-RS annotations must be on the service interface or RESTEasy will not be able to find them.

Live class reloading


Available since tapestry-resteasy 0.2.1!

The only thing you need to do to enable live class reloading for your REST services is to bind them as regular Tapestry IoC services and contribute them to Read more about how service implementation reloading works in:

Here is an example from the tapestry-resteasy test suite.

One more thing: DO NOT put this service in the autodiscovery package.



If you get this exception:

Add this to your system properties:

like so:

mvn jetty:run

Check google for more information:


version table

tapestry-resteasyTapestryRESTEasynotes: tapestry-resteasy-0.0.1 guide  
  • No labels