0

I have been checking this answer and I am not sure it covers my case. Also, it is almost 6 years old and JSF has evolved a lot since then. My question is simple, I have:

public class ReadContext {
    public static String readName() throws NamingException {
    ...
    }
}

And I need to call it from my xhtml template as well as from some other random places from different pages. So I would like to do something like:

<a href="documents.xhtml">#{ReadContext.readName()}</a>

Because they are quite a few pages, I would prefer not to load a Controller in each of them. Is there a more elegant / easier way to do it in the new JSF than the options suggested in the question above?

(Note: I am using TomEE 7)

user1156544
  • 1,725
  • 2
  • 25
  • 51

0 Answers0