среда < /strong> < /p>
Windows 7(64)
jdk1.7.0_51(64)
RESTEasy3.0.7
apache-tomcat-7.0.50
Project Name: hello
< /code>
resteasyhelloworldservice.java:
package com.javacodegeeks.enterprise.rest.resteasy;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
@Path("/RESTEasyHelloWorld")
public class RESTEasyHelloWorldService {
@GET
@Path("/{param}")
@Produces(MediaType.TEXT_PLAIN)
public String getMsg(@PathParam("param") String name) {
String msg = "Rest say: good " + name;
return msg;
}
}
< /code>
web.xml:
hello
resteasy-servlet
/rest/*
resteasy.scan
true
resteasy.servlet.mapping.prefix
/rest
org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
resteasy-servlet
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
Почему я получаю исключение, когда я называю http: // localhost: 8080/hello/rest/resteasyhelloworld/a
return:
javax.ws.rs.NotFoundException: Could not find resource for full path: http://localhost:8080/hello/rest/RESTEasyHelloWorld/a
at org.jboss.resteasy.core.registry.ClassNode.match(ClassNode.java:73)
at org.jboss.resteasy.core.registry.RootClassNode.match(RootClassNode.java:48)
...
Подробнее здесь: https://stackoverflow.com/questions/252 ... -full-path