The above code wouldn't throw any exception from knowledge, it will rather show a compilation error like : "Can't instantiate the Device", as we can't create a object of interface type e,g. new Device().
And here the changes made to get java.lang.InstantiationException:
1:Remove class attribute from <jsp:useBean>
<jsp:useBean id="mobile" scope="request" type="bean.Device" />
2: And set attribute of type Device somewhere in your jsp or
servlet like :
in a jsp which will forward request to the another jsp where jsp:useBean has been used.
<%
Phone mobile = new Phone();
session.setAttribute("mobile",mobile) ;
%>
Now if run this we will definetly get and InstantiationException as we set the attribute in "session" and trying to get it in "request" scope and we dont have a class attrribute.
This all changes successfully get back youaInstantiationException ,which I think required by you.