dan volfman

+ Follow
since Jan 15, 2010
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by dan volfman

i have a few questions about jsf and localization.
assume i have the following definition in faces-config.xml

In my jsf page i use bundle.abc to get the value of abc (which is mapped in labels.properties). i also have labels_de.properties

the question is - what locale is used in in this bundle?

i configured the locales:

but it didnt make the page take the values from labels_de.
only when i define <f:view locale="de_DE"/> in the page, the value is taken from labels_de.properties.
Can someone please explain how this works?


9 years ago
i need something that will act like an xmlAdapter, but will be defined on a xmlRootElement (rather than on a field).

the purpose is custom marshalling and unmarshalling of fields which will be determined by the fields values.
for example, if a field value is of a particular syntax, then the field will be changed while unmarshalling .

i have a lot of objects that are serialized to xml files, and a lot of fields that potentially could be changed, and thats why i'm looking for a solution at the rootElement level and not at the field level.

any suggestions?

ok, thanks.
now, if i use bundle to get a properties file. how can i make the bundle reload when the properties file changes? or reload every defined time?

clearCache() doesnt do the job..

10 years ago
if i use ResourceBundle.getbundle("aaa"), more than one time, does the bundle loads each time i use this, or only the first time?

10 years ago
i tried adding flush() after the persist but it is still the same.

just a thought: shouldnt the tables be created anyway? even before i persist entities?
my db is empty, no tables.
is it possible i'm doing something wrong in the persistence unit?

here's the code:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">;
<persistence-unit name="LibraryApp-ejbPU" transaction-type="JTA">
<property name="toplink.jdbc.user" value="nbuser"/>
<property name="toplink.jdbc.password" value="nbuser"/>
<property name="toplink.jdbc.url" value="jdbc:derby://localhost:1527/LibraryDB"/>
<property name="toplink.jdbc.driver" value="org.apache.derby.jdbc.ClientDriver"/>
<property name="toplink.ddl-generation" value="drop-and-create-tables"/>
<property name="toplink.ddl-generation" value="drop-and-create-tables"/>

i have the following bean:
public class LibraryServicesBean implements LibraryServicesLocal {
EntityManager em;

public void test() {

Category cat = new Category();


(Category is a normal entity bean which i can persist when i dont use session beans.)

and the following code in the client:

static LibraryServicesLocal library;

public static void main(String[] args) {


I use netbeans and its local DB.

when i run the application i get no exceptions but the entity is not persisted. (i check the db and there are no tables).

any ideas of what i'm doing wrong?

thank you.