wood burning stoves 2.0*
The moose likes JSF and the fly likes EL functions in FACELETS... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "EL functions in FACELETS..." Watch "EL functions in FACELETS..." New topic
Author

EL functions in FACELETS...

Arun Thulaseedharan
Greenhorn

Joined: May 07, 2008
Posts: 20
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
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15952
    
  19

You should be able to overload the Properties class and make its load method do the loading from a database. Nothing JSF-specific needed.


Customer surveys are for companies who didn't pay proper attention to begin with.
Arun Thulaseedharan
Greenhorn

Joined: May 07, 2008
Posts: 20
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

Joined: Jun 25, 2001
Posts: 15952
    
  19

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EL functions in FACELETS...
 
Similar Threads
how to get the display tag behave for the locale chage.
Urgent: How to set fixed locale for all user's request?
changing locale of websites dynamically
language propertis to xml properties
how to set the locale for display tag