akub
akub

Reputation: 99

Find out what the current page is in JSF 1.2

I need to figure out what the current page is I'm on using a bean.

Something like getting the current form id from facesContext and compare it to a const string.

Upvotes: 1

Views: 597

Answers (1)

Arjan Tijms
Arjan Tijms

Reputation: 38163

You could use facesContext.getViewRoot().getViewId().

Be aware that this is the current JSF view that's being processed. If you use forwarding techniques via a Servlet or do navigation without a redirect, this is not necessarily the same as what the user's address bar is showing.

Upvotes: 1

Related Questions