1

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.

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
akub
  • 99
  • 2
  • 10

1 Answers1

1

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.

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140