jsf - What would be a good way to display static message in facelets? -


i came across following managed bean , .xhtml in jsf 2.x application. static variable has long string value , referred bean in .xhtml page display message. armed limited experience of java/jsf, decided improve somehow.

  1. take out static first step
  2. create proper getter/setter methods
  3. load text message properties file.
  4. bind loaded value message variable

not convinced of myself googled here , found thread: fetching values property file inside xhtml file. sounds promising hoping find best practice in regards load/referring static message in jsf.

@managedbean @viewscoped public class foo {     private static string message = "....long...message...";      // getter available     public string getmessage() { .... } 

from .xhtml page:

<h:outputtext value="#{foo.message}" /> 


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -