Я пытаюсь сделать отдых, но он не работает.Мой отдых не работает
Мой исследователь проекта;
Мой web.xml является;
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>HelloRest</display-name>
<servlet-mapping>
<servlet-name>javax.ws.rs.core.Application</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
IHello.java;
@Path("hello")
public interface IHello {
@GET
@Path("sayHello")
public String sayHello(@QueryParam("name") String name);
}
Hello.java;
public class Hello implements IHello {
@Override
public String sayHello(String name) {
return "Hello: " + name;
}
}
Я вызываю его из браузера;
http://localhost/HelloRest/rest/hello/sayHello?name=me
но оно не возвращается.
Если я позвоню;
http://localhost/HelloRest/aa/index.html,
Я могу видеть содержимое index.hmtl.
Какова моя проблема и как ее исправить?
Примечание: развернуть его с Wildfly-10.1
Спасибо за комментарий, но я меняю порт с 8080 на 80 на standalone.xml, поэтому 'http: // localhost' верен. Я устанавливаю путь приложения из web.xml как отдых, поэтому мне не нужно расширять приложение, поэтому 'http: // localhost/HelloRest/rest' также корректно. Но что-то не так, и я этого не знаю. – xxlali