Sometimes you run into a scenario where you have an evaluated EL expression property, that is used widely through your JSF page. Evaluating the value each time is a waste of performance.
JSTL core <c:set> helps you caching the value into a scoped variable, that can be accessed later on through the scope it’s defined on.
Using PrimeFaces 3.5 and RichFaces 4.3.0.Final in the Same Maven Application
It seems like every time you try to run these two together, you should spend some time configuring them.
After some googling and testing, here’s what my pom.xml looks like:
Clickable PrimeFaces Wizard Tabs
PrimeFaces wizard component <p:wizard> is awesome, but recently in my work I was asked to get the tabs clickable, which are not by default in version 3.5.
This is a full tutorial explaining how you can achieve this.
Java Localization with PropertyResourceBundle
A tutorial about PropertyResourceBundle object and .properties files; how to create them, load their values, use them in business logic code, or JSF view page.
This tutorial will try to gather all the uses in one place.
Resizing java.awt.Image with constraining proportions using ImageUtil
With every application I create, I always come into image manipulation, which can be really tricky in Java and sometimes even complicated.
The function that was always needed is to resize an image after the client user uploads it, or reduce its quality.
As you know when ever you feel like a function needed over and over you go and create a utility class for it, so you can use it easily in any new projects.
ImageUtil.java is the class I created. It contains one method (for now) called resizeImage.
I’ll leave you with the full class, read the documentation for class usage and method functionality.
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
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.
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.
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.
Using <a4j:repeat> with <rich:datascroller> to create pure html <table> records
Many data-iteration components are out there, and so many of them are pretty advanced, but in some cases you would just need the pure and clear <table> with its known <tr> and <td>.
You can achieve that with many ways in JSF, in this post I wrote it using <a4j:repeat>.
