Tomcat中web.xml文件的详细说明
<?xml version="1.0" encoding="GB2312"?> <!--
Web.xml依次定议了如下元素:
<web-app>
<display-name></display-name> 定义了WEB应用的名字
<description></description> 声明WEB应用的描述信息
<filter></filter>
<filter-mapping></filter-mapping>
<servlet></servlet>
<?xml version="1.0" encoding="GB2312"?> <!--
Web.xml依次定议了如下元素:
<web-app>
<display-name></display-name> 定义了WEB应用的名字
<description></description> 声明WEB应用的描述信息
<filter></filter>
<filter-mapping></filter-mapping>
<servlet></servlet>
Tags: TOMCAT
今天在eclipse+myeclipse+tomcat5 下,写个中文乱码转码filter,就报
2007-3-13 17:43:46 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2007-3-13 17:43:46 org.apache.catalina.core.StandardContext start
严重: Context startup failed due to previous errors
错误,所属项目也就启动不了,web。xml配置为 :
<filter>
<filter-name>CharsetEncodingFilter</filter-name>
<filter-class>com.changyou.filter.CharsetEncodingFilter</filter-class>
2007-3-13 17:43:46 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2007-3-13 17:43:46 org.apache.catalina.core.StandardContext start
严重: Context startup failed due to previous errors
错误,所属项目也就启动不了,web。xml配置为 :
<filter>
<filter-name>CharsetEncodingFilter</filter-name>
<filter-class>com.changyou.filter.CharsetEncodingFilter</filter-class>
Tags: TOMCAT
Exception Processing ErrorPage[errorCode=404,location=*.jsp]
java.net.SocketException: Connection reset by peer: socket write error
出现这样的错误源于web.xml的配置,起初配置的是:
更改为文件名错误解除:
java.net.SocketException: Connection reset by peer: socket write error
出现这样的错误源于web.xml的配置,起初配置的是:
复制内容到剪贴板
程序代码

<error-page>
<error-code>404</error-code>
<location>/index.do</location>
</error-page>
<error-code>404</error-code>
<location>/index.do</location>
</error-page>
更改为文件名错误解除:
在webapps\ROOT下放置index.htm就可用执行,而index.jsp反而不执行,也有很多人在讨论这个问题。
解决方法如下:
修改server.xml文件,在Host 里面的加入以下的代码:
<Context path="" docBase="C:\wwwroot\" workDir="C:\wwwroot\" />
其中path是为"", 不是"/" , docBase就是你放置网页的目录, workDir也是你放置网页的目录,并且这个参数必不可少,我在添加代码的时候没有添加这个参数,搞得不能运行.那么整体的代码如下:
解决方法如下:
修改server.xml文件,在Host 里面的加入以下的代码:
<Context path="" docBase="C:\wwwroot\" workDir="C:\wwwroot\" />
其中path是为"", 不是"/" , docBase就是你放置网页的目录, workDir也是你放置网页的目录,并且这个参数必不可少,我在添加代码的时候没有添加这个参数,搞得不能运行.那么整体的代码如下:
Tags: TOMCAT
1. 在server.xml中定义context时采用如下定义:
2. 在web.xml中通过参数指定:
复制内容到剪贴板
程序代码

<Context path="/livsorder" docBase="/home/httpd/html/livsorder"
defaultSessionTimeOut="3600" isWARExpanded="true"
isWARValidated="false" isInvokerEnabled="true"
isWorkDirPersistent="false"/>
defaultSessionTimeOut="3600" isWARExpanded="true"
isWARValidated="false" isInvokerEnabled="true"
isWorkDirPersistent="false"/>
2. 在web.xml中通过参数指定:
复制内容到剪贴板
程序代码

<session-config>
<session-timeout>30</session-timeout>
<session-timeout>30</session-timeout>