Reply To: Dynamic view ID not working.

Splash Forums PrettyFaces Users Dynamic view ID not working. Reply To: Dynamic view ID not working.

#27143

Peter-TI
Participant

Sure Christian, if you where trying to address me for the pattern value.

Problem Dynamic view ID solved.

I guess the solution was to use the @ManagedBean(name=”loginBean”) annotation instead of @Named.
I’m sorry for not having this noted.

Anyway my bean was:


package navigation;

import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

/**
 *
 * @author peter
 */

@ManagedBean(name="loginBean")
@RequestScoped
public class LoginBean implements Serializable{
    private String page;
    private String login;
    
    public void setPage(String page){
        this.page=page;
    }
    public String getPage(){
        return page;
    }
    public void setLogin(String login){
        this.login=login;
    }
    
    public String getLogin(){
        System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!LoginBean Called");
        return "/specifications/noordzij-it/frontend/pages/index.xhtml";
    }
}

And my pretty-config.xml was:


 <url-mapping id="home">
		<pattern value="/" />
		<view-id value="#{loginBean.getLogin}" />
	</url-mapping>

Works for me.

  • This reply was modified 6 years, 8 months ago by  Peter-TI.