The Daily Bugs

A web developer's daily life

July 11, 2011

Solving “PWC4011: Unable to set request character encoding to UTF-8″

As I was going on with my new project using JSF 2.1.2 on glassfish 3.1 I reached a point where I needed to write a ‘UTF-8′ text. As in every project before, I had my tags and configurations ready to handle such cases, but this time all I was getting in my database is a gibberish text like “عÙØ”.
Checked the glassfish log file and this next warning was all over the log:

WARNING: PWC4011: Unable to set request character encoding to UTF-8 from context /your_webapp, because request parameters have already been read, or ServletRequest.getReader() has already been called

Read More

July 6, 2011

Adding Richfaces 4.0.0.Final Libraries to Your Project

Richfaces 4.0.0.Final is out there, and so far it’s pretty useful as usual, but when I wanted to add it in my NetBeans project on JSF 2.1.2, many exceptions, many unrecognizable stack traces.
I started googling, after hundreds of results and surfing I ended up with collecting what I needed to get it working, and to my surprise I needed three extra jars.

Read More

July 6, 2011

Using Richfaces 4.0 and Primefaces 3.0.M1 in the Same Web Application

They’re both great, they both have a very useful components that it’s just not easy to give up on one of them, it has been the same since Richfaces 3.0 and Primefaces 1.0.
Long story cut short, what happens when you use them together is that Richfaces’ components works “almost” normally, while Primfaces’ just don’t.
The normal components like panels, and buttons doesn’t seem to have much trouble, but components that uses extensive Javascript and Ajax actions such as calendars will be a trouble running.

Read More

February 6, 2011

Installing PHPUnit with MAMP

Installing PHPUnit can be a little bit complicated with MAMP specially if you were running through incompatible versions.
I got it running after twisting my mind for many hours searching, so it deserves a full tutorial.
You’ll install PHPUnit using “Pear” installer and we’ll use the one that came with MAMP not the one with Mac OSX. The installation will take place in the command line so go ahead and open Applications -> Utilities -> Terminal
All the commands supplied down “should” work perfectly for you just copy and run.

Read More

December 10, 2010

Arabic and UTF-8 Languages with iReport

When you try to integrate iRerport into your Java application’s reporting system, you might run into a problem figuring out how to implement utf-8 based languages with the generated PDF report file.
Characters will be replaced by void, or question marks ????.
Here’s how I solved it:

Read More

December 9, 2010

Friendly URLs in JSF with Glassfish

You can’t help but noticing the easy and beautiful friendly url in PHP pages, that it all depends on apache’s mod_rewrite and unfortunately Glassfish doesn’t have it, and if you want to apply it in JSF, or JSP you have to implement phase listeners, filters and, and …
Luckily tuckey.org created an API based on apache’s url rewrite.
Get the library, and here’s how you use it.

Read More

Newer Posts