Created
February 9, 2014 22:35
-
-
Save ryan-ju/8907085 to your computer and use it in GitHub Desktop.
Weld + Resteasy configuration example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Context> | |
<Resource name="BeanManager" | |
auth="Container" | |
type="javax.enterprise.inject.spi.BeanManager" | |
factory="org.jboss.weld.resources.ManagerObjectFactory"/> | |
</Context> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<dependencies> | |
<dependency> | |
<groupId>org.jboss.resteasy</groupId> | |
<artifactId>resteasy-cdi</artifactId> | |
<version>3.0.6.Final</version> | |
</dependency> | |
<dependency> | |
<groupId>org.jboss.weld.servlet</groupId> | |
<artifactId>weld-servlet</artifactId> | |
<version>2.1.0.Final</version> | |
</dependency> | |
</dependencies> | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<web-app xmlns="http://java.sun.com/xml/ns/javaee" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee | |
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" | |
version="3.0"> | |
<listener> | |
<listener-class>org.jboss.weld.environment.servlet.Listener</listener-class> | |
</listener> | |
<servlet> | |
<servlet-name>Resteasy</servlet-name> | |
<servlet-class> | |
org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher | |
</servlet-class> | |
<async-supported>true</async-supported> | |
<init-param> | |
<param-name>javax.ws.rs.Application</param-name> | |
<param-value>put your application class's fqn here</param-value> | |
</init-param> | |
</servlet> | |
<servlet-mapping> | |
<servlet-name>Resteasy</servlet-name> | |
<url-pattern>/*</url-pattern> | |
</servlet-mapping> | |
<resource-env-ref> | |
<resource-env-ref-name>BeanManager</resource-env-ref-name> | |
<resource-env-ref-type> | |
javax.enterprise.inject.spi.BeanManager | |
</resource-env-ref-type> | |
</resource-env-ref> | |
</web-app> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment