开发者

How to forward to another page in a managed bean constructor? [duplicate]

开发者 https://www.devze.com 2023-01-09 12:12 出处:网络
This question already has an answer here: Redirect before loading the page in JSF2 [duplicate] (1 answer)
This question already has an answer here: Redirect before loading the page in JSF2 [duplicate] (1 answer) Closed 7 years ago.

How can I forward to another page inside the constr开发者_运维技巧uctor of a backing bean? I don't want to use redirect.

EDIT:

Thank you very much BalusC.

Is FacesContext.getCurrentInstance().getExternalContext().dispatch("page.jsf") safe if I call it inside a getter method? The getter method will be invoked by JSF in the Render Response phase.


You need to invoke a method to do this. Constructors are not methods, and cannot return the "PAGE2" string.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号