This rule flags the <jsp:useBean> entries for a JSP that has class attribute, but no type attribute. The behavior has changed in WebSphere Application Server Version 5.1 which tightened the conformance to JSP 1.2.
Specifically, you should use the type attribute to specify a Java type that cannot be instantiated as a JavaBean. For example, a Java type that is an abstract class, interface, or a class with no public no-args constructor. If the class attribute is used for a Java type that cannot be instantiated as a JavaBean, the WebSphere Application Server JSP container produces a unrecoverable translation error at translation time.
Example:
| <jsp:useBean id="myClass" class ="com.MyClass" /> |
In the example, the jsp:useBean will be flagged.
The quick fix adds a type attribute with the same value as the class. Make sure that this is the type you want. In the preceding example, after the quick fix is applied, the code will be:
Example after quick fix is applied:
| <jsp:useBean id="myClass" class ="com.MyClass" type = "com.MyClass" /> |
For additional information, see