passing values between beans

Splash Forums PrettyFaces Users passing values between beans

This topic contains 1 reply, has 2 voices, and was last updated by  Lincoln Baxter III 8 years, 5 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #24563


    I am having circular dependencies issues, however I think it’s because I am not using pretty faces correctly.

    I have 2 backing beans and

    the method in searchObject class is as follows:

    public String editResults() {
    		if ( null != selectedResults ) {
    			return "pretty:manageResourceRoleRoleType";
    		} else {
    		       return null;

    the manageObject class is below:

    @URLMappings( mappings = {
    				@URLMapping( id = "manageResourceRole", pattern = "/physical/role/manageResourceRole/#{iid :}", viewId = "/physical/role/manageResourceRole.jsf" ),
    				@URLMapping( id = "manageResourceRoleRoleType", pattern = "/physical/role/manageResourceRole/#{roleTypeTest : findResourceRole.roleType}/#{iid :}", viewId = "/physical/role/manageResourceRole.jsf" ),
    				@URLMapping( id = "manageResourceRoleBySpecification", pattern = "/physical/role/manageResourceRole/spec/#{manageResourceRole.roleType}/#{manageResourceRole.specificationId}", viewId = "/physical/role/manageResourceRole.jsf" ) } )
    public class ManageResourceRole extends AbstractBackingBean implements Serializable {
    	public void load() {
    		tabBean.setActiveIndex( 2 );
    		if ( null != getId() ) { // Edit Object

    My question is, how do I get the values that are in the URL so that getID() can be accessed by the backing bean?

    the only thing I have tried that worked is this

            List<PathParameter> params = PrettyContext.getCurrentInstance().getCurrentMapping().getPatternParser().parse(PrettyContext.getCurrentInstance().getRequestURL());



    Hello there!

    I believe what you are asking is how do you access the values that PrettyFaces has already injected into your beans via the path parameters you’ve specified in your URLMapping: #{roleTypeTest : findResourceRole.roleType}/#{iid :}

    If this is the case, then my suggestion would be to @Inject the FindResourceRole bean into your ManageResourceRole bean so that you can programmatically access them via the java API:

    However, using CDI is the preferred approach here:

    I hope this helps,


Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘PrettyFaces Users’ is closed to new topics and replies.

Comments are closed.