-
1. Re: problem using reasteasy
andrea.leoncini Feb 6, 2012 5:35 AM (in response to andrea.leoncini)I was able to make it run using the alternative method as following:
I've changed the library class whici is now
package it.jboss.jbs.spikes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
@Path("/lib")
public class Library {
@GET
public String getInfo() {
return "Simple REST Service";
}
@GET
@Path("/xml")
@Produces({ "application/xml" })
public String getHelloWorldXML() {
return "<xml><result>Hello World</result></xml>";
}
}
and adding a servlet mapping to the web.xml
<web-app version="3.0" 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">
<servlet-mapping>
<servlet-name>javax.ws.rs.core.Application</servlet-name>
<url-pattern>/rs/*</url-pattern>
</servlet-mapping>
</web-app>
By the way I would like to understand what was wrong with the first method
thanks
andrea