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).

赞(0) 打赏
分享到: 更多 (0)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏