In the useBean standard action we can use class and type attributes in combination.
Yes u can use both class & type.
Is there is any specific case where you should use both in one useBean standrad action.
This is clearly explained in SCWCD exam study kit.If u dont have one here is a simple example.
interface animal{}
class dog implements animal{}
class cat implements animal{}
In
java we get used to use the stmt something like this :
animal a = new dog();
What is it implying?.Parent reference is pointing to child object.In the same way we can use it for usebean declaration in
JSP also.
<jsp:usebean id="pet" class="dog" type="animal" scope="session"/>
The above declaration is equivalent for the following stmts
animal pet = (animal)session.getAttribute("pet");
if(animal==null){
pet = new dog();
}
hth..
Regards,
Priya.