首页 > 代码库 > 已发布的jsp项目如何在本地展示
已发布的jsp项目如何在本地展示
已发布的项目可以放到tomcat 安装目录下的webapps/下面,但是有时候我们的目录已经放好了,所在要加映射过去。
1, 到tomcat/conf/下,打开server.xml
2, 找到
<style>p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Monaco; color: #cd7923; background-color: rgba(0, 0, 0, 0.93) } p.p2 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Monaco; color: #34bc26; background-color: rgba(0, 0, 0, 0.93) } p.p3 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Monaco; color: #878787; background-color: rgba(0, 0, 0, 0.93); min-height: 19.0px } p.p4 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Monaco; color: #34bbc8; background-color: rgba(0, 0, 0, 0.93) } p.p5 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Monaco; color: #28fe14; background-color: rgba(0, 0, 0, 0.93) } span.s1 { color: #34bbc8 } span.s2 { color: #34bc26 } span.s3 { color: #28fe14 } span.s4 { } span.s5 { color: #878787 } span.s6 { color: #cd7923 } span.s7 { color: #afad24 } span.s8 { color: #a8a8a8; background-color: #0000ff }</style><Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="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" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
3, 从这里可以看,默认目录是在webapps, 修改目录指向,添加语名:
<style>p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Monaco; color: #cd7923; background-color: rgba(0, 0, 0, 0.93) } span.s1 { color: #28fe14 } span.s2 { color: #34bbc8 } span.s3 { color: #a8a8a8; background-color: #0000ff } span.s4 { color: #34bc26 } span.s5 { } span.s6 { color: #878787 }</style><Context docBase="你项目的绝对地址" path="" reloadable="true"/>
4, 完整的host
<style>p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Monaco; color: #cd7923; background-color: rgba(0, 0, 0, 0.93) } p.p2 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Monaco; color: #34bc26; background-color: rgba(0, 0, 0, 0.93) } p.p3 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Monaco; color: #878787; background-color: rgba(0, 0, 0, 0.93); min-height: 19.0px } p.p4 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Monaco; color: #34bbc8; background-color: rgba(0, 0, 0, 0.93) } p.p5 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Monaco; color: #28fe14; background-color: rgba(0, 0, 0, 0.93) } span.s1 { color: #34bbc8 } span.s2 { color: #34bc26 } span.s3 { color: #28fe14 } span.s4 { } span.s5 { color: #878787 } span.s6 { color: #cd7923 } span.s7 { color: #afad24 }</style><Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="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" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
<Context docBase="******"path="" reloadable="true"/>
5, 重启tomcat, 先shutup, 再startup
<style>p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Monaco; color: #cd7923; background-color: rgba(0, 0, 0, 0.93) } span.s1 { color: #28fe14 } span.s2 { color: #34bbc8 } span.s3 { color: #a8a8a8; background-color: #0000ff } span.s4 { color: #34bc26 } span.s5 { } span.s6 { color: #878787 }</style>
已发布的jsp项目如何在本地展示