• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EL functions in FACELETS...

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi guys,
my question is when we are using EL FUNCTIONS for internationalization we are making use of tat static function to read the message properties file and locale and get the things accoridng to the locale from the properties....
my doubt is,is it possible to retrieve the datas from a database which we usually get from the properties file using the functions present in facesContext...if its possible, is ther any defualt functions available for doing the same as we hav for message property files....

thanks in advance,
thanks and regards,
arun
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should be able to overload the Properties class and make its load method do the loading from a database. Nothing JSF-specific needed.
 
Arun Thulaseedharan
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
that means we dont have any functions in the api which allow us to retirve frm database and we should use our own functions in that class???

thanks in advance,
arun
 
Tim Holloway
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nothing specific to JSF. You can probably find some samples of utility classes that overload the Properties load() method using a database as a source.

There are 2 main reasons why nothing specific to DBMS's:

First, because you can arrange the properties in the DBMS however you like and different people like different ways. There's no "one-size-fits-all" solution.

Secondly, flat files and DBMS's aren't the only ways to get properties. I could use LDAP, a web service, even the Fairy Courier Delivery Service. So rather than try for every possible specific solution, they made the Properties class extensible.

A DBMS-loaded Properties class shouldn't be too difficult. Just extend java.util.Properties and overload the load() method with one that opens the connection to the DBMS, reads the key/value pairs and does a "this.setProperty()" against each. And closes the connection when you're done, of course.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic