日期:2014-05-16  浏览次数:20357 次

servlet-api.jar、jsp.jar 项目环境与部署容器 冲突的问题

工程中依赖这两个jar

所以必须加入classpath

?

但是部署到tomcat下会与common/lib冲突

?

有人说解决办法是手动去删

有人说解决办法是在JAVA_HOME中加入这两个jar

但更好的办法应该是直接不让它部署

?

在maven中:

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

?

?

这个在myelipse中还有问题需要:

Most people should be able to hot-deploy as normal now using the MyEclipse server tools, however i have noticed some people have problems with servlet-api.jar and jsp-api.jar conflicts, if that is the case then the following steps should fix that:

?

Right click on your project and go to the properties>java build path>libraries You will need to look through this list for servlet-api.jar and jsp-api.jar, remove them and add the J2EE library (You will need to do this each time you run the eclipse target or else your servlet-api.jar and jsp-api.jar will get deployed to your web server and may interfere with the one it already has in it’s classpath

?

Next, still under the project properties item go to MyEclpse->Web->Deployment uncheck the ‘workbench default settings’ and ‘Jars in web Projects user Libraries’ you should now be able to do a normal MyEclipse hot-deploy…

?

见http://www.oneadam.net/?p=39

?

感谢大牛GL的指导!