开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜