?先介紹如何讓Spring2.0在Resin下正常運(yùn)行。
因?yàn)镽esin缺省沒有用xerces解析xml,所以resin無法解析Spring2.0的配置文件。
具體做法:1. 拷貝xercesImpl.jar,xml-apis.jar,如果用到xslt,還需要拷貝xalan.jar;
2. 將下面幾行加入到resin.conf中:
<system-property javax.xml.parsers.DocumentBuilderFactory='org.apache.xerces.jaxp.DocumentBuilderFactoryImpl'/>
<system-property javax.xml.parsers.SAXParserFactory='org.apache.xerces.jaxp.SAXParserFactoryImpl'/>
如果用到xslt,還要加入一行:<system-property javax.xml.transform.TransformerFactory='org.apache.xalan.processor.TransformerFactoryImpl>
?
也就是說,對(duì)于一些特殊的url,可以使用plugin_match來讓resin來服務(wù),而plugin_ignore的作用正好相反。
在這里,我們需要plugin_match,為了避免打亂正常的配置,我們使用和web.xml文件相同作用的resin-web.xml來設(shè)置相應(yīng)的url,這樣設(shè)置僅對(duì)resin有效,不影響其他server,還是不錯(cuò)的。
最后的resin-web.xml是這樣的:
<web-app xmlns="
http://caucho.com/ns/resin">
?<servlet-mapping url-pattern='/struts/*' servlet-name='plugin_match'/>
?<servlet-mapping url-pattern='/other/*' servlet-name='plugin_match'/>
?<servlet-mapping url-pattern='*.action' servlet-name='plugin_match'/>
?<servlet-mapping url-pattern='*.html' servlet-name='plugin_match'/>
?<servlet-mapping url-pattern='*.do' servlet-name='plugin_match'/>
?<servlet-mapping url-pattern='/dwr/*' servlet-name='plugin_match'/>?????????????
</web-app>
這樣struts2的action就可以正常工作了。
?
另外,如果url后面自動(dòng)跟上jsessionid的話,resin會(huì)反應(yīng)404找不到網(wǎng)頁(yè)的錯(cuò)誤。在host里配置里加上<session-config enable-cookies='true' enable-url-rewriting='false'/>可避免些問題。
摘自:
http://mtiger2k.blog.51cto.com
posted on 2006-12-27 08:19
壞男孩 閱讀(1710)
評(píng)論(2) 編輯 收藏 所屬分類:
俠客島