File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 16305
    
  21

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: 16305
    
  21

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...