问题:
使用Maven骨架创建Web项目时, New 里面没有 servlet
原因:
pom.xml中没有导入相关jar包
解决方法
在dependencies里面加上相关jar就行
<!--放置的都是项目运行所依赖的jar包-->
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
922

被折叠的 条评论
为什么被折叠?



