This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I was shocked to see that I got a ClassCastException Bean classes are well defined and are accessible without any problems. What I noticed is that pageContext.findAttribute() is being used in jsp:setProperty and thats why my string attribute named "abc" got a ClassCastException.
You declare 'abc' as a page-scoped variable of type String. Then you use a useBean action that specifies a different class. This is wrong. The useBean action will create a new variable only if a scoped variable with the specifid id does not already exist. When a scoped variable already exists, the useBean action binds to the existing variable.
And since the existing variable is of a different type than the action declares, you get a ClassCastException. Plain and simple.