A certain managed bean has an action method that returns "/private/myview.jsf"
. However, without changing this code, I want to perform some checks and eventually render the view "/private/other/myview.jsf"
.
So, in summary, I want to translate "/private/myview.jsf"
to "/private/other/myview.jsf"
somewhere after the method return and before the actual view rendering.
How to achieve that?
Environment:
- Eclipse Luna
- Java 1.7
- JSF 2
Current condition
Web application fully operational but not developed to support accessibility features.
Requirement for the next version
To be an application good enough to be used by blind people who uses screen readers.
Details
After some study, we reached the conclusion that we will have to have an accessible version of each page we have nowadays.
We will design such accessible version of each page, the matter is when to show the not accessible version and when to show the accessible version.
We decided that the application will turn to accessible mode (that will not be the default state) when the user clicks a certain link in the top of the page. In accessible mode, only accessible versions of pages are rendered.
We don't want to review all the application, what we want is to intercept some phase of JSF and replace the outcome that should be rendered. For instance, consider the follow:
- A certain page has a link or a button to another one, let's say
"mysettings.xhtml"
; - When in accessible mode, we would like to tell to JSF to not render
"mysettings.xhtml"
, instead"mysettings_ac.xhtml"
or"accessible/mysettings.xhtml"
should be rendered; - Both pages will interact with the very same managed beans and will provide the very same features, but one will be good to the ones who can see and the other will be designed to be comfortable to screen reader users.
Thanks in advance!