没有合适的资源?快使用搜索试试~ 我知道了~
java urlrewrite解决默认页问题
5星 · 超过95%的资源 需积分: 34 36 下载量 157 浏览量
2012-06-21
17:03:08
上传
评论
收藏 1KB TXT 举报
温馨提示
试读
2页
这是我在工作中碰到的一个问题,在网上找了好久都没有找到相关的资料,经过研究,已经解决掉,拿出来和大家共享一下。
资源推荐
资源详情
资源评论
在j2ee项目中使用使用urlrewrite时,遇到了struts默认页和urlrewrite相冲突的问题。在网上也没有查找到相关的资料,经过测试终于解决了这个问题,下面记录下来,供大家参考。
框架:struts1.3+hibernate3.2
url包:urlrewrite2.6
action类:
public class EntryinfAction extends DispatchAction {
//转向注册页面
public ActionForward index(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response) {
EntryinfForm vo = (EntryinfForm) form;
try {
return (mapping.findForward("test"));
} catch (Exception e) {
e.printStackTrace();
return (mapping.findForward("error"));
}
}
}
struts-config.xml文件
<action-mappings>
<action attribute="entryinfForm" name="entryinfForm" path="/entryinf" scope="request" parameter="method" type="com.ylb.action.EntryinfAction" >
<forward name="test" path="/test.jsp" />
</action>
</action-mappings>
下面是配置urlrewrite
框架:struts1.3+hibernate3.2
url包:urlrewrite2.6
action类:
public class EntryinfAction extends DispatchAction {
//转向注册页面
public ActionForward index(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response) {
EntryinfForm vo = (EntryinfForm) form;
try {
return (mapping.findForward("test"));
} catch (Exception e) {
e.printStackTrace();
return (mapping.findForward("error"));
}
}
}
struts-config.xml文件
<action-mappings>
<action attribute="entryinfForm" name="entryinfForm" path="/entryinf" scope="request" parameter="method" type="com.ylb.action.EntryinfAction" >
<forward name="test" path="/test.jsp" />
</action>
</action-mappings>
下面是配置urlrewrite
资源评论
- u0110497082014-04-01不错,学了点
- 桾楉叁杄2015-09-09还可以吧,需要稍微调整下才能满足需求
- SDSW19902012-10-10楼主nice,解决了我不少问题,顶下
- NobleBaron2013-07-01还可以吧,问题最后自己解决的
relay_001
- 粉丝: 0
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功