Embedded tomcat 7 servlet 3.0 annotations not working

后端 未结 4 702
孤独总比滥情好
孤独总比滥情好 2020-12-01 03:19

I have a stripped down test project which contains a Servlet version 3.0, declared with annotations like so:

    @WebServlet(\"/test\")
public class TestServ         


        
4条回答
  •  栀梦
    栀梦 (楼主)
    2020-12-01 03:51

    I think in 8.5 and later it's just one liner:

    Context.setAddWebinfClassesResources(true);

    Sets the flag that indicates if /WEB-INF/classes should be treated like an exploded JAR and JAR resources made available as if they were in a JAR.

    http://tomcat.apache.org/tomcat-8.5-doc/api/org/apache/catalina/core/StandardContext.html#setAddWebinfClassesResources(boolean)

提交回复
热议问题