Author: dan.j.allen
Date: 2010-08-19 22:36:46 -0400 (Thu, 19 Aug 2010)
New Revision: 6991
Modified:
archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/JaxRsActivator.java
Log:
document modifications required to get JAX-RS working on JBoss AS 6.0.0.M4
Modified: archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/JaxRsActivator.java
===================================================================
---
archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/JaxRsActivator.java 2010-08-20
02:36:19 UTC (rev 6990)
+++
archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/JaxRsActivator.java 2010-08-20
02:36:46 UTC (rev 6991)
@@ -4,13 +4,35 @@
import javax.ws.rs.core.Application;
/**
- * This empty, annotated {@link Application} class is the Java EE 6 "no XML"
- * approach to activate JAX-RS. Resources are served from the servlet path
- * specified in the @ApplicationPath annotation.
- *
- * NOTE As of JBoss AS 6.0.0.M3, JAX-RS does not activate properly.
+ * A class extending {@link Application} and annotated with @ApplicationPath
+ * is the Java EE 6 "no XML" approach to activating JAX-RS.
+ *
+ * <p>Resources are served relative to the servlet path specified in the {@link
+ * ApplicationPath} annotation.</p>
+ *
+ * <p><strong>NOTE</strong><br/>The following modifications are
required to get
+ * JAX-RS working on JBoss AS 6.0.0.M4:</p>
+ *
+ * <ol>
+ * <li>Remove (or comment out) the <code>extends Application</code>
clause on this class</li>
+ * <li>Remove (or comment out) the <code>@ApplicationPath</code>
annotation on this class</li>
+ * <li>Open up web.xml and add the following XML snippet:
+ * <pre>
+ * <context-param>
+ * <param-name>resteasy.scan</param-name>
+ * <param-value>true</param-value>
+ * </context-param>
+
+ * <context-param>
+ *
<param-name>resteasy.servlet.mapping.prefix</param-name>
+ * <param-value>/rest</param-value>
+ * </context-param>
+ * </pre>
+ * <p>The mapping prefix should match the value that was in the
<code>@ApplicationPath</code> annotation, prefixed
+ * with a forward slash (/).</p></li>
+ * </ol>
*/
-@ApplicationPath("/rest")
+@ApplicationPath("rest")
public class JaxRsActivator extends Application
{
/* class body intentionally left blank */
Show replies by date