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

工程中依赖这两个jar

所以必须加入classpath

 

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

 

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

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

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

 

在maven中:

		
			javax.servlet.jsp
			jsp-api
			2.1
			provided
		

 

 

这个在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的指导!

你可能感兴趣的:(开发实践)