views:

195

answers:

4

Hi, 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.

A: 

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.

Drew
A: 

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.

Damo
A: 

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

Lincoln
+2  A: 

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;
    } 
}
Lincoln