karimkhan pathan wrote:
Pavn Igor wrote:Use page directive to extend any java class.
<%@ page extends="your.java.class">
From the above ...
JSP will automatically extend to HttpServlet class ..if we extend another class ,java does not support multiple inheritance ,how its achieved .
Hi everybody, can anybody please explain why there is no error if I extend a java class in a jsp page, java does not support multiple inheritance and I am not getting any error.
Thank you all in advance
Bear Bibeault wrote:Ulf, is right on the money. The days of dealing with JSPs as if they were Java classes, or even putting Java code in a JSP are long long passed. Let's all catch up to 2010 and forget about this type of outdated nonsense.
The code written inside the declaration tags been treated as members of the class..
So the classes defined in above JSP are treated as inner classes.
For extending a class in your Servlet... You have to implement Servlet and ServletConfig interfaces where you are not required to extend HTTPServlet, you can extend another class.
However can you give a requirement where you need to extend someother class in your servlet or jsp?
Is it not possible to do the things without extending a class?