在使用时修改Tomcat的server.xml文件,把项目部署到Tomcat没问题,在eclipse中部署之后不报错,但是访问页面有问题。
解决方式:
修改eclipse中Servers中的server.xml
**<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context path="" docBase="F:/软件/apache-tomcat-7.0.76/webapps/mdap-report" debug="0" reloadable="true"/>**
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t "%r" %s %b" prefix="localhost_access_log." suffix=".txt"/>
<!-- <Context docBase="F:\软件\apache-tomcat-7.0.76\wtpwebapps\report" path="/report" reloadable="true" source="org.eclipse.jst.jee.server:report"/> -->
<Context docBase="report" path="/report" reloadable="true" source="org.eclipse.jst.jee.server:report"/>
</Host>
将maven项目转化为web
用鼠标点击web项目右键properties