Enrique Villamizar

Ranch Hand
+ Follow
since Jul 30, 2005
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 Enrique Villamizar

since you are hard-coding "UTF-8" into the Java code of your filter, that means that you don't need to specify it as an init-param of the filter.

Yes Paul, you are absolutely right!

The little problem I didn't mention is that I was trying to catch the parameter ("encoding" from web.xml) in the overriding init method of SetCharacterEncodingFilter class but it didn't work so, when I hard-coded "UTF-8" and I saw the right result I felt so exciting than I couldn't help to tell the world about it. Thanks for your cooperation and I will heed your advice.

P.S. English is not my mother tongue.

- Hello everybody:

Finally after trying out various means or theories by trial and error I got the following solution:

I created a filter to encode the character set for response/request. In the request was the problem since the browser (or server?) was changing the enconding when updating the form. No change needed to the database.

But in the web.xml

To be honest I don't undestrand very well this solution but was the only one I found. I hope it doesn't bring me side effects.

Thank you for all your help.
Hello again Bill Gorder

Is it also correct when you read it out of the database?

yes, it's.

So the problem is when sending the data to the database. What should I check? the server?
Hello Bill Gorder

Thank you for your reply. I read that article before and I added to my Hibernate configuration file:

I thought the following file was needed and I added too:

Needless to say it is not working. Thanks again.
Additional information.
Apache configuration server httpd.conf has: AddDefaultCharset UTF-8
Java version 1.6

The above image shows an example with the word 'boy' in Spanish.

P.S: English isn't my mother tongue.
Since some days ago I’ve been trying to solve the following problems:

In a Web application Spanish characters like don't display the right way.

I’m using Hibernate 3.2.5, JSF 2.1, Java EE 5, Tomcat 6, Oracle 10g.

In the client

In the hibernate.cfg.xml

Seeking for solutions I tried to change the Oracle NLS_CHARACTERSET WE8ISO8859P1 to NLS_CHARACTERSET AL32UTF8 but it didn't work.

Now I notice a weird behavoir: When a client data is update using ajax the Spanish character are saved correctly, but when all the form is updated is saved the wrong way. I don't how to do. If someone can help me I'd be very grateful.

Thanks Guy deLyonesse for your help.

That's a better idea... Now I have a custom validation. Anyway I would like to use Ajax for instant validation ( I mean no waiting until the entire form will be submitted). How can I do it?
10 years ago
Hello to Everybody:

I have a selectOneMenu. If the user select one specific value relating to age of a person, I need to validate if this selection is valid based on code in the Backing bean. I am using Ajax and I don´t undestand why when the selection is not valid the selectOneMenu is not rendering.

The XHTML code:

On the backing bean:
10 years ago
I tried to flush the Session, and it didn’t work. I understand that we use flush in DML operation to synchronize the in-memory Session state with the database. Since I’m running a query I think I don’t need to flush the Session.

Finally I used a Transaction and now my query works well, I mean, it renders the last changes I made in the DB.

Nevertheless I don´t understand why I need a Transaction for a query (read-only). Why, when no using Transaction, the first time I run the query I get the correct data but when the data change in the database my page doesn’t show the last changes. Is it a kind of cache? If a transaction is also needed for queries why the first time it works?

The following code doesn't work.

Where my old data is saved since every time the method is called I begin a new Session, clean the result list (list = null) and I also clean the Query (query = null)?

A Transaction is needed for queries???

The following solved my problem:
Hi to everybody:

The last few days I have been trying to solve the following problem but still I don't know what is hapenning.

I have a ManagedBean (RequestScoped) which has a method returning a String (the name of a navigation page). This bean has a method that opens a Hibernate Session, create a simply org.hibernate.Query "from Customer" and save the result in a List<Customer> customers and finally close the Session.

The first time the application begins it retrieves the data from a MySQL table and show it in the view and everything is OK. Nervertheless when I change data directly in the database and execute the method my view doesn't reflect the changes and I don't see why, because my method every time Open the Hibernate Session, clean the List and execute the Query once again, save the result en the List and close the Session.

In the view I use a datatable.

If I redeploy my application it refreshes the data the first time but it never does it again.

Please, could you tell me what could be the problem? The browser cache (Firefox 3.69)? The Scope of the Bean? Hibernate Configuration? o ...?

Tools: Netbeans 6.9.1, Tomcat 6.0, Hibernate3.5, primefaces 2.2.1.

Thanks in advanced for your help.

I think Sai could be right:

So adds to the page and in the back Bean (yourBean):

11 years ago
Hi to everyone:

I´m taking my first steps on PrimeFaces. I'm running a dataTable but the page only shows the last item of a list and I have no idea what I'm missing.

NetBeans 6.9
JSF 2.0
Apache Tomcat 6.0
JDK 1.6

My *.xhtml page:

My Bean:

The first problem is the folloing line:

Throws an error: javax.el.ELException: "fn:length" Not Found

When I delete the the page is showed but it prints only the last item of the car list.

11 years ago
Hi to everybody:

I want to iterate over an ArrayList and I'm using the JSF 2.0 ui:repeat. On the backbean there is something like this:

ArrayList<Class> lista;

In the xhtml page:

When I run it:

An Error Occurred:

At the beginning I thought I needed an extra library and added JSTL 1.1 ( Netbeans 6.8 - Tomcat 6) what it didn't work. Could anyone tell me what I'm doing wrong?
Do I need a library or is any configuration I'm missing?

Thanks in advance for your help.

12 years ago
Hi once again Ivan:

I think I got your idea. I keep on trying ... wait for news soon.

Thank you very much for your patience and good advice.
12 years ago
Hi Ivan Krizsan:

Thank you once again for helping me.

This is my first web service I’m trying to do in my lifetime. Before using a DB connection I used fixed data and it works perfectly. So, since my mother tongue is not English, let me see if I understood what you wrote: I shouldn’t execute the query directly in the webmethod but in a separate class?
12 years ago