Posts Tagged ‘jsf’

JSF Interview questions

November 18th, 2010 No comments

Another set of JSF Interview questions at Skill-Guru . Tests your knowledge of JSF concepts.

Our earlier JSF Interview questions had received a very good response. Hop you will like this one too.

Categories: Interview questions Tags:

IE7 ignores table width

August 23rd, 2010 3 comments

There has been a problem in using table width in IE7.

The pre tags in IE 7 do wrap the text but the table width will remain wider and scrollbar appears, as if the text is taking full space. This problem doesn’t come in Firefox and Chrome. Can anyone help me out defining proper style for IE 7 for pre tags. for eg of you look at this code

 <style type="text/css">

pre {
width: 600px;
 white-space: pre-wrap;       /* css-3 */
 white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
 white-space: -pre-wrap;      /* Opera 4-6 */
 white-space: -o-pre-wrap;    /* Opera 7 */
 word-wrap: break-word;       /* Internet Explorer 5.5+ */
 display: block;
<table width="70%" border="1">
 <tr> <td width="100%">
<pre> This is sample long text only to test IE 7 table width and it should be wrapping around but that does not happen . So we will have to find a solution </pte>
</td> </tr> </table>

You would not face this problem in Firefox or IE8.  It only happens with IE.

Solution : Use  table-layout: fixed;

If you apply the table-layout:fixed style for the inner table, where the data is in different columns, all columns get same area irrespective of their defined width.  But if applied it to the outer table, and it works fine.

Categories: Programming / tutorials Tags: , ,

Tomcat 6.0.26 shutdown reports “A web application created a ThreadLocal …. ThreadLocal has been forcibly removed”

August 22nd, 2010 3 comments

This problem happened with an JSF , Hibernate and rich faces application which was running on tomcat 6.0.14 version and Jdk1.6.0 . When upgraded to Tomcat 6.0.26 and JDK 1.6.0-19, it started behaving strangely.

The jsf messages were displayed as html  and looked as the servver was not parsing them.

for eg {userbean.errorMessage} started showing on pages.

After much analysis it was found that this problem is because of tomcat upgrade.  Why is this problem ?

From the documentation

For the #{} expressions to be recognized in Tomcat 6, your web application must adhere to the Servlet 2.5 specification. Make sure, that version and xsi:schemaLocation attributes of element in your WEB-INF/web.xml file have the correct values. You can look into conf/web.xml or into the examples application for an example.
In the versions 6.0.24 and earlier the deferred expressions were processed regardless of the specification version specified in web.xml. That was changed/fixed in 6.0.26.

Below is solution


<?xml version=’1.0′ encoding=’UTF-8’?>
“-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN”



<?xml version=”1.0″ encoding=”UTF-8″?>


remove these if they exist in your web.xml





If this was helpful , please add comment below

Categories: Programming / tutorials Tags: ,

java.lang.SecurityException – igner information does not match signer information of other classes in the same package

July 6th, 2010 6 comments

If you encounter this exception

Caused by: java.lang.SecurityException: class “com.sun.faces.util.FacesLogger”‘s signer information does not match signer information of other classes in the same package

at java.lang.ClassLoader.checkCerts(
then it caused by by 2 jars in your lib path with different versions. For eg for above exception , there were two versions of jsf jars in our lib folder.
Categories: Programming / tutorials Tags:

SEO friendly URL in JSP/JSF applications

May 31st, 2010 No comments

While I had been working in j2ee enterprise application, the SEO friendly url’s was never an objective. It was never required that each page should have a unique bookmarkable url.

But things change completely in world wide web world. SEO is hot . All the pages should have a unique user friendly url.

In Skill-Guru although we had unique url for the test pages, they were never user friendly. Our url’s were like

So we took the project of re architecting the application to have a clean , user friendly , bookmarkable url.  We looked at couple of options like url rewriting in .htaccess file on the server.

Then we discovered pretty faces.  Pretty faces utility has been written by Lincoln Baxter. This makes life so much easier for application developer . It also left the control with the developer to manage the url within the application instead of managing on server.

I am not going into details of pretty faces as Lincoln has done an excellent job on documentation. Now the url’s in our application are user freindly.

Thanks to pretty faces we now have pretty URL’s.

JSF 2 – New features

May 20th, 2010 1 comment

In our last post , Getting started with JSF , we had covered JSF1.2.  JSF has come a long way from that.  JSF 2 has come with very new features, some of them taken from different frameworks / components.  Now JSF developers don’t have to look out. JSF2 helps JSF developers to keep their application simple.
There are many articles explaining new features of jsf 2. But here in this blog, I brief you some of the features:

1. The introduction of  View scopes, flash scope and custom scope – View scopes,Flash scopes and custom scopes are ‘bigger than request scope but smaller than session scope’. Many times developers are forced to keep objects in session scope just because they want the objects available till end of their front view operation or make them work in the redirection or till end of their front end operation.  For example you might have experienced implementing edit/delete/ add operations to datatable,  many times its necessary to make the bean session scope to make it working right way. This can be avoided by view scope variables. The custom scope helps objects to be available till end of user operation (user has to decide the scope of bean). This is like flow scope.Flow scopes were offered by frameworks like spring webflow etc .. But for an application already done in JSF, it is easier to shift to JSF2 than webflow.
Read more…

Categories: Programming / tutorials Tags: , ,

Is Spring Web Flow Right for Me ?

May 20th, 2010 2 comments

Web based application beyond a size become complex to manage. Page definitions,  managing application flow , state management , orchestration of all this become a difficult task. That is why we have frameworks to ease out this task for us.

One of the choices which come to mind is Spring webflow.  Spring webflow is for management of page flow , navigation and state management. It is not an full fledged MVC framework like JSF 2.0 or Apache Struts.

You might get confused by the definition of Spring webflow on its home page

Spring Web Flow is the project in the Spring Portfolio that focuses on providing the infrastructure for building and running rich web applications. As a Spring project, Web Flow builds on the Spring Web MVC framework to provide: Read more…

Mixed Case URL in link

May 14th, 2010 No comments

Programmers when creating url and page name sometimes create mixed case URL for eg

Now this may be a good programming practice but it is not a good practice from user perspective.  Mixed case URLs are an absolute no-no, as Unix and Linux servers are case sensitive. Having mixed case URLs drastically increases the possibility of typos . It is always difficult for users to remember the url (if they can).

So try to keep all your url’s in lower case.

Categories: Programming / tutorials Tags: , ,