Configuring Jersey + Jetty + JSP

纵饮孤独 提交于 2019-12-08 23:05:48

You should change the line with context.addServlet(h, "/*") as follows:

context.addServlet(h, "/rest/*");

You can remove WebPageContentRegex and JSPTemplatesBasePath init params - they are useless in this case. And move your JSP's out of the WEB-INF/jsp directory.

If you are using maven, your project structure should look as follows:

└───src
    └───main
        ├───java/Main.java
        │   └───resources/HelloResource.java
        └───webapp/NewFile.jsp
            └───WEB-INF/web.xml (optional)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!