dan volfman

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

Recent posts by dan volfman

hi
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?

thanks.

9 years ago
JSF
hi,
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?

thanks.
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
hi
if i use ResourceBundle.getbundle("aaa"), more than one time, does the bundle loads each time i use this, or only the first time?


thanks.
10 years ago
hi
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">
<provider>oracle.toplink.essentials.PersistenceProvider</provider>
<non-jta-data-source/>
<class>entities.Category</class>
<class>entities.Book</class>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<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"/>
</properties>
</persistence-unit>
hi,

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

public void test() {

Category cat = new Category();
cat.setCategoryName("aaa");
em.persist(cat);

}
}

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

and the following code in the client:

@EJB
static LibraryServicesLocal library;

public static void main(String[] args) {

library.test();
}

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.