Can not connect JAX-RS service to MVC template

后端 未结 4 415
抹茶落季
抹茶落季 2021-01-02 20:22

I\'m attempting to make use of JAX-RS\' (Jersey) MVC pattern. Attempts to reach http://localhost:8080/myproject/foos/test result in an error that reads:

jav         


        
4条回答
  •  一向
    一向 (楼主)
    2021-01-02 21:05

    I had this same error running under Jetty 9. The application ran fine using mvn clean jetty:run but had this error when packaged as a war and deployed under Jetty. This is the fix in web.xml that worked for me:

             
                 com.sun.jersey.config.property.JSPTemplatesBasePath
    -            /WEB-INF/views/
    +            /WEB-INF/views
             
    

    Yep, that's it. So, hopefully this helps someone who stumbles across this. My config is basically the same as craig's, but had the extra slash.

提交回复
热议问题