dear friend, you are forcing the container to create object for an abstarct class. I mean your specified type attribute in <jsp:useBean> is com1.Bean1, which is actually is an abstract. You can't create an object for an abstract class. That's why you may be getting problem. I think this may help you
you are forcing the container to create object for an abstarct class.
Not exactly. Had seetharaman used the class attribute to point to his abstract class, then yes, the container would look for an instance of that class in the specified scope and then, if not found, try to instanciate one using that class's zero argument constructor. If the class could not be instanciated (which it couldn't if it's abstract) then an exception would have been thrown.
In this case, he's used the type attribute. When this is done, the server will not try to create an object of that type or a suitable subtype. If it can't find an instance of that type in the specified scope, it will throw an exception.
Make sure that a bean of the specified type is established in the specified scope. Otherwise, you'll get the exception. If that's not what you are intending, what is?
Make sure that a bean of the specified type is established in the specified scope.
You have your bean set in the appropriate scope (page, request, session) wherever appropriate and from where you are picking it up. That means, set the scope in the useBean tag so that the JSP Engine would do the needful.
i think in this way we have to put bean into the scope -------------------------------------- <% com.Bean b=new com.Bean(); request.setAttribute("ins",b);%> //or i put this in servlet ---------------------------------