首页 > 代码库 > java.lang.ClassCastException: cn.itcase.serviceImpl.servicestudentImpl cannot be cast to javax.servlet.Servlet

java.lang.ClassCastException: cn.itcase.serviceImpl.servicestudentImpl cannot be cast to javax.servlet.Servlet

java.lang.ClassCastException: cn.itcase.serviceImpl.servicestudentImpl cannot be cast to javax.servlet.Servlet

可能原因(1)因为这个只不过是一个是实现类而已,它本身是不能访问的,只有通过servlet来调用这些方法,并用doGet()或者doPost()方法来实现才是可以的

可能原因2:servicestudentImpl本来需要 extends HttpServlet但是没有继承

 

java.lang.ClassCastException: cn.itcase.serviceImpl.servicestudentImpl cannot be cast to javax.servlet.Servlet