2008-05-20
在websphere6中部署应用遇到的struts问题
在一个应用程序包部署到websphere6中后,出现一下异常:
[07-1-15 19:18:47:234 CST] 00000027 ActionServlet E Parsing error processing resource path
[07-1-15 19:18:47:250 CST] 00000027 ActionServlet E TRAS0014I: 下列异常已记录 java.net.MalformedURLException: SRVE0238E: 资源路径应该以斜杠开头
at com.ibm.ws.webcontainer.webapp.WebApp.getResource(WebApp.java:1915)
at com.ibm.ws.webcontainer.facade.ServletContextFacade.getResource(ServletContextFacade.java:100)
at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:1002)
at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:955)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:470)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at com.ibm.ws.webcontainer.webapp.WebApp.getResource(WebApp.java:1915)
at com.ibm.ws.webcontainer.facade.ServletContextFacade.getResource(ServletContextFacade.java:100)
at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:1002)
at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:955)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:470)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
.
.
.
java.net.MalformedURLException: SRVE0238E: 资源路径应该以斜杠开头
...
该应用包在websphere5.x中部署正常,后发现websphere使用的struts版本问题.
Struts 1.1 中,获得资源路径时,前面不带斜线( / ),但在Servlet 2.4规范中,要求在获得一个资源路径时,路径必须是相对与当前上下文根并以斜线( / )开头,在WebSphere Application Server 5.x中使用的是struts1.1版本规则,而websphere6则使用了Servlet 2.4版本的规则,故导致问题出现.
解决办法是:利用websphere6兼容websphere5.x的方法:
具体为:
在WebSphere6 管理控制台中,进入 服务器->对应的服务器名称 -> WEB容器设置->WEB容器 -> 其他属性->定制属性 ->添加
添加下面的属性:
名称:prependSlashToResource
值:true
添加下面的属性:
名称:prependSlashToResource
值:true
重启websphere即可.
===补充,因为上面的问题,后来查了文档:发现还有个注意点:这个不知道会不会出现,这里先急着:
§JSP useBean tag
4Tightened conformance to JSP 1.2
4Old: <jsp:useBean id="pg" class="exp.ObjExp.exampleTbl" scope="request" />
4New: <jsp:useBean id="pg" type="exp.ObjExp.exampleTbl" scope="request" />
- 22:25
- 浏览 (102)
- 评论 (0)
- 分类: websphere系列
- 相关推荐
发表评论
- 浏览: 86733 次

- 详细资料
搜索本博客
我的相册
730
共 2 张
共 2 张
最近加入圈子
最新评论
-
正确理解hibernate的inve ...
8) 引用引用引用引用
-- by wyl232 -
inline函数的用法小议(转 ...
-- by joyjiang -
Javascript遍历JavaScript ...
-- by avalon0406 -
关于DB2数据库的ADM11003 ...
学习了,谢谢
-- by efan101 -
java调用db2存储过程例子 ...
既然是给新手看的,可不可以把需要的包也加进来
-- by efan101






评论排行榜