tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <funk...@joedog.org>
Subject Re: getServletContext call from jsp page...
Date Fri, 11 Oct 2002 18:48:29 GMT
Adding extra functionality is not a bad thing as long as it conforms to 
the spec. But using the extra functionality makes your code non-portable.

Of course, one may also think this a bug since Jasper assumes your JSP 
extends HttpServlet and you may issue a directive
<%@page extends="my.Clazz" %> where my.Clazz does NOT extend HttpServlet 
  and only implements JspPage which has significantly less functionality.

As a side note:
BEA weblogic does not inherit their JSP's from HttpServlet, so that is 
one platform where you would have trouble if you made the assumption 
from below.

Padhu Vinirs wrote:
> 
> Wanted to know if this assumption is valid in most jsp containers:
> 
> Is calling getServletContext()  ( instead of 
> getServletConfig().getServletContext() ) assuming that the servlet 
> generated from the jsp will be derived from HttpServlet ?
> 
> 
> This works ( in Tomcat ) because HttpJspBase derives from HttpServlet. 
> But getServletConfig() is part of the interface Servlet which every 
> Servlet has to implement.
> 
> -- padhu
> 



--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message