1、设置debug
[url]http://sw1982.iteye.com/blog/360154[/url]
2、用脚本杀死tomcat进程
3、web.xml设置error page
[b][color=red]注意:当配置了<exception-type>java.lang.Exception</exception-type>时,服务器出错日志是在tomcat的log里,这个需要注意[/color][/b]
4、设置welcome file
[b][color=red]注意:webroot下必须要有index.htm这个文件存在[/color][/b]
5、配置虚拟目录
[url]http://sw1982.iteye.com/blog/360154[/url]
2、用脚本杀死tomcat进程
APP_SERVER_NAME=apache-tomcat-6.0.32
#先shutdown
~/work/$APP_SERVER_NAME/bin/shutdown.sh
#杀死
pid=$(jps -v | grep /home/lisboa/work/$APP_SERVER_NAME/ |sed -n '1p' |awk '{print $1}');
if [ -n "$pid" ];
then
{
kill -9 $pid
sleep 3s
}
fi
3、web.xml设置error page
[b][color=red]注意:当配置了<exception-type>java.lang.Exception</exception-type>时,服务器出错日志是在tomcat的log里,这个需要注意[/color][/b]
<error-page>
<error-code>400</error-code>
<location>/error.htm</location>
</error-page>
<!-- 404 页面不存在错误 -->
<error-page>
<error-code>404</error-code>
<location>/error.htm</location>
</error-page>
<!-- 500 服务器内部错误 -->
<error-page>
<error-code>500</error-code>
<location>/error.htm</location>
</error-page>
<!-- java.lang.Exception异常错误,依据这个标记可定义多个类似错误提示 -->
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error.htm</location>
</error-page>
4、设置welcome file
[b][color=red]注意:webroot下必须要有index.htm这个文件存在[/color][/b]
<welcome-file-list>
<welcome-file>index.htm</welcome-file>
</welcome-file-list>
5、配置虚拟目录
<Context path="/upload" docBase="D:\upload" reloadable="true" debug="0"></Context>