Java Restful Service eclipse tomcat HTTP Error 404

帅比萌擦擦* 提交于 2019-12-01 22:00:29

You're using the old (1.x) Jersey configuration. In Jersey 2.x, the class namescpaces and property names have changed. You should instead use

<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
    <param-name>jersey.config.server.provider.packages</param-name>
    ...

See other deployment options here

localhost:8080/com.freespots.rest this URL will run welcome page which is index.html as you said, and localhost:8080/com.freespots.rest/api/hello here no page found so 404 not found error. Try to put @Path("name") above method and call localhost:8080/com.freespots.rest/api/hello/name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!