Tomcat 笔记

[size=medium][b]1. web.xml中的filter链[/b][/size]
acegi与struts的filter都在一个链中,一个包含action URI请求传到web server后,按照filter chain,先进行acegi处理,然后struts在处理action URI对应的action类,后转到对应的jsp上,这时在web server内部通过struts跳转的jsp不会去acegi做过滤处理。
通过acegi,struts等的filter源代码跟踪调试,可以判断出filter配置中定义的匹配URI是针对来自web server外部的请求。

[size=medium][b]Tomcat 5.5源代码调试环境搭建[/b][/size]
1. 从apache 站点 下载Tomcat 5.5 源代码
2. eclipse.classpath, eclipse.project这两个文件是tomcat 5.5 在eclipse下的两个工作区文件参考内容,将这两个文件内容分别拷贝到实际工作区里对应的.classpath和.project两个文件里。使tomcat 5.5源代码工作区使用tomcat的开发环境参数。
3. 下载ant,并在eclipse里设置ANT_HOME变量值。整个tomcat 5.5源代码编译可以使用ant进行整体编译。
4. 进入根目录的build子目录,新建build.properties,将同目录下的build.properties.default文件内容拷贝到build.properties里。
打开full.dist=on参数开关,为了下载javamail和Activation两个jar
设置base.path参数,将它指向自定义的目录,该目录存放tomcat 5.5源代码所依赖的第三方jar。
5. 在根目录的build子目录中,选择build.xml,运行ant download这个ant 目标,开始执行源代码依赖包的下载。
如果tomcat 5.5源代码项目的根目录下的子目录有与当前执行ant 编译命令下的jdk 版本不一致的情况时,将子目录下原有的class文件删掉,重新运行ant。
6. 在eclipse中,以debug模式启动发布版本的tomcat时,可以将它与编译好的tomcat源代码调试环境挂接起来。
设置步骤:打开eclipse中的Servers操作面板,双击 tomcat 5.5 server 条目,在打开的服务器设置主窗口中,点击‘Overview’标签面板上的‘Open launch configuration', 在它的设置面板中,在Source标签页中将tomcat源代码工作区引入。

[size=medium][b]Question:simple error due to use of double quotes in a jsp file[/b][/size]
Answer: 在tomcat的启动文件中的启动命令里加入如下参数:
-Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false



[size=medium][b]Tomcat中文字符集的设置[/b][/size]

<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" URIEncoding="UTF-8" useBodyEncodingForURI="true"/>


[size=medium][b]1, install tomcat6 as service of Windows[/b][/size]
walk into TOMCAT_PATH\bin, there is service.bat.

[install service]
service install tomcat6

[start service]
net start tomcat6

[stop service]
net stop tomcat6

[remove service]
service remove tomcat6



[b][size=medium]other:[/size][/b]
[/list]1. For apache-tomcat-6.0.16\conf\Catalina\localhost\xxx.xml, file name should be same as application name in apache-tomcat-6.0.16\webapps

2. server.xml (set root app in tomcat)
<Context path="" docBase="xxx" debug="0" reloadable="true" crossContext="true">
</Context>

3. put ojdbc14.jar into TOMCAT_HOME/common/lib to address issue that oracle.jdbc class etc can not be found.

4. 端口冲突问题。 IIS占用80端口

java.lang.Exception: Socket bind failed: [730013] An attempt was made to access
a socket in a way forbidden by its access permissions.
at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:646)


[size=medium][b]用于查看端口的命令[/size][/b]
netstat -a -b -p  tcp
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值