jeypijeypi
jeypijeypi

Reputation: 55

How to load a JSF page after file upload?

what i want is to load another page after performing a fileUpload.

I tried to put this code in the bean which process the fileupload:

return "<JSF Page Name>?faces-redirect=true"

but still no luck...

Upvotes: 3

Views: 1603

Answers (1)

BalusC
BalusC

Reputation: 1108692

You can't navigate from inside an action listener method. You can only navigate from inside a real action method, the one which is bound to the action attribute of an UICommand component.

You can however send a redirect programmatically by ExternalContext#redirect():

FacesContext.getCurrentInstance().getExternalContext().redirect("page.xhtml");

Upvotes: 5

Related Questions