直接将web应用放到tomcat的webapps目录下。
tomcat的默认路径是访问localhost时会指向webapps,所以部署项目时候将启动的class等,放到webapps里,新建一个项目目录,将webcontent里的东西直接放进去即可
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
创建tomcat项目时,当访问路径写到项目名时会直接找到webcontent目录下的jsp文件,默认路径
或者
如果需要修改访问的默认路径,可以配置:server.xml里配置
在host目录下
<Context path="/bsfw" docBase="D:\php-workspace-20130524\acjsp\WebContent" reloadable="true"/>
访问bsfw自动定位到D:\php-workspace-20130524\acjsp\WebContent下找对应的文件
或者在Tomcat 6.0\conf\Catalina\localhost下配置上响应的xml:例如访问的bsfw.xml
<?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <Context docBase="D:\php-workspace-20130524\acjsp\WebContent" reloadable="true"/>