漂亮脸蛋与缝豆

发布于 2024-07-30 18:25:08 字数 897 浏览 5 评论 0原文

尝试解决这个问题两天了,没有任何运气。 创建的 bean 时,就会出现问题

<url-mapping id="test">
    <pattern>/test/#{testBean.param}</pattern>
    <view-id>/test.faces</view-id>
</url-mapping>

当我尝试在 Pretty-config.xml 中定义一个 url 映射来中继使用 Seam bean 源

package com.web.jsfbean;

import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Create;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;

@Name("testBean")
@Scope(ScopeType.CONVERSATION)
public class Test {
    private String param;

    @Create
    public void init() {
        param = "initialized";
    }

    public String getParam() {
        return param;
    }

    public void setParam(String param) {
        this.param = param;
    }
}

:如果我在 faces-config 中定义这个 bean,一切都会按预期工作。

任何想法 ?

预先感谢您的任何帮助。

Trying to solve this problem for two days without any luck.
The problem occur when i try to define a url-mapping in pretty-config.xml that relay on a bean created with Seam

<url-mapping id="test">
    <pattern>/test/#{testBean.param}</pattern>
    <view-id>/test.faces</view-id>
</url-mapping>

bean source:

package com.web.jsfbean;

import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Create;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;

@Name("testBean")
@Scope(ScopeType.CONVERSATION)
public class Test {
    private String param;

    @Create
    public void init() {
        param = "initialized";
    }

    public String getParam() {
        return param;
    }

    public void setParam(String param) {
        this.param = param;
    }
}

if i define this bean in faces-config everything works as expected.

Any idea ?

Thanks in advance for any help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

七分※倦醒 2024-08-06 18:25:08

这个特定问题已在 PrettyFaces 3.0.1 版本中得到修复:

现在,当使用 Seam 2.x 时,您将使用以下类型的映射:

<url-mapping id="test">
        <pattern>/test/#{ paramName }</pattern>
        <view-id>/test.faces</view-id>
</url-mapping>

然后您将使用 Seam @RequestParameter("paramName") 注释来访问它。

@Name("testBean") @Scope(ScopeType.CONVERSATION) public class Test {

    @RequestParameter("paramName")
    private String param;

    @Create
    public void init() {
        param = "initialized";
    }

    public String getParam() {
        return param;
    }

    public void setParam(String param) {
        this.param = param;
    } 
}

This specific issue has been fixed in versions 3.0.1 of PrettyFaces:

Now, when using Seam 2.x, you would use the following type of mapping:

<url-mapping id="test">
        <pattern>/test/#{ paramName }</pattern>
        <view-id>/test.faces</view-id>
</url-mapping>

Then you would access this using the Seam @RequestParameter("paramName") annotation.

@Name("testBean") @Scope(ScopeType.CONVERSATION) public class Test {

    @RequestParameter("paramName")
    private String param;

    @Create
    public void init() {
        param = "initialized";
    }

    public String getParam() {
        return param;
    }

    public void setParam(String param) {
        this.param = param;
    } 
}
謸气贵蔟 2024-08-06 18:25:08

您遇到的问题到底是什么? 我对此很感兴趣。 PrettyFaces 应该与 Seam 一起使用。 尝试在用户群组中发布您的问题:http://groups.google.com/group/prettyfaces -用户

What exactly is the problem you are experiencing? I'm intrigued by this. PrettyFaces should work with Seam. Try posting your question on the users group: http://groups.google.com/group/prettyfaces-users

渡你暖光 2024-08-06 18:25:08

查看 JAX-RS。 Jersey 是 RI,我个人使用 JBoss 的产品 (RESTEasy)。这个框架将让您更简单地做您想做的事情。

Check out JAX-RS. Jersey is the RI and I personally use JBoss's offering (RESTEasy.) This framework will let you do what you want to do a little more simply.

疯到世界奔溃 2024-08-06 18:25:08

它应该与 Seam 一起使用,尝试更改 web.xml 中过滤器的顺序。

Seam 确实捆绑 UrlRewriteFilter 如果您只想添加书签。

It is supposed to work with Seam, try changing the order of your filters in web.xml.

Seam does bundle UrlRewriteFilter if all you are after is bookmarking.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文