Seam的redirect.captureCurrentView不能记住URL的参数
例如 components.xml 中的
<event type="org.jboss.seam.security.notLoggedIn">
<action execute="#{redirect.captureCurrentView}" />
</event>
不能将URL中的参数记住,并在跳转后恢复到URL上
使用被注解成@deprecated的Redirect.captureCurrentRequest()也不行。
只好自己写了,代码如下
@Name("org.jboss.seam.faces.redirect")
@BypassInterceptors
@Scope(ScopeType.CONVERSATION)
@Install(precedence=APPLICATION, classDependencies="javax.faces.context.FacesContext")
@PerNestedConversation
public class MyRedirect extends Redirect {
public void captureCurrentViewAndRequest() {
super.captureCurrentView();
Map<String, Object> pmap = FacesUtil.getServletRequest().getParameterMap();
for (String key : pmap.keySet()) {
if (!StringUtils.equals(key, "cid")) {
this.setParameter(key, FacesUtil.getRequestParameter(key));
}
}
}
}
在 components.xml 中的配置,改成
<event type="org.jboss.seam.security.notLoggedIn">
<action execute="#{redirect.captureCurrentViewAndRequest}" />
</event>
分享到:
相关推荐
Seam 2.X Web Development
09年新书,seam 2.x web development,不错的一本关于seam的书,不过是英文的
#Generated by seam setup #Mon Jun 08 21:07:28 CST 2009 #数据库密码 hibernate.connection.password=testSeamGen #工作目录 workspace.home=E\:/workspace_seam #实体存放路径 model.package=...
j-seam2.zip,关于j-seam2的内容,介绍的非常详细。推荐。
Manning.Seam.in.Action.Sep.2008.pdf
Apress.Beginning.JBoss.Seam.Feb.2007.pdf 自己备份用的
Apress.Beginning.JBoss.Seam.Feb.2007.rar
jboss.seam.simplicity.and.power.beyond.java.ee2007
Practical.JBoss.Seam.Projects.pdf
Seam - 语境相关的组件[满江红20071230]............................................................................................................................ 1 Java EE 框架...........................
Beginning.JBoss.Seam.很好的东西,只有英文版
基于最低能量的线裁剪的图像拼接matlab
https://mp.csdn.net/editor/html/117332248 源代码
java培训课程_JBOSS_SEAM开发
JBOSS.SEAM.WEB应用开发 中文版 (美)MichaelYuan.
此教程从基础讲述了使用Seam的开发过程,是一本很好的入门英文教程,英文内容也比较简单
jboss seam 的英文书籍
•Recent Developments in Analysis and Testing of Spot and Seam Welds local approach which was first proposed by Pook in 1975. •The key to the local approach is the determination of local stress ...
jboss-seam-2.1.1.GA.jar.zip
seam框架需要的所有jar包,支持seam ui组件