spring – @Controller causing java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest – Stack Overflow

@Controller causing java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest

来源: spring – @Controller causing java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest – Stack Overflow

You are probably missing right dependencies, like:

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <scope>provided</scope>
        <version>3.1.0</version>
    </dependency>           

Please note that your version could be 2.5, 3.0 or 3.1 – it depends on application server you are using. Also when you want to create executable war you should probably not use provided scope (depending on your servlet container).

本文来自网络,不代表Mikel立场,转载请注明出处:http://www.mikel.cn/%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/java/spring-controller-causing-java-lang-noclassdeffounderror-javax-servlet-http-httpservletrequest-stack-overflow.html
关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部