简体   繁体   中英

can we extend multiple classes in jsp page using export attribute

We can define multiple attributes in a single page directive or we can have multiple page directives in a single JSP page. But can we extend multiple classes in any jsp page using extends attribute?

for eg:

<%@ page extends="Class1" %>
<%@ page extends="Class2" %>

extends Specifies a superclass that the generated servlet must extend

This means that writing <%@ page extends="Class1" %> is kind of equivalent to

class MyClass extends Class1 {}

because JSP page is compiled to java class with similar name (depending on container). Since java does not support multiple inheritance writing more than one JSP attribute extends must be illegal.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM