tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Smith <>
Subject Re: Superclass for JSPs?
Date Fri, 06 Apr 2001 19:45:01 GMT
I honestly don't know if it's possible to subclass
your JSP pages, but I may have a hack workaround. 
First, know that you can declare a 'jspinit()' method
that is just like the 'init()' method in your servlet.
 Search the following doc for details:

Also, you might use the 'include' directive to include
a jsp file in all of your other jsp pages.  For
instance, you may write a 'init_and_utils.jsp' file
and use the jsp include directive to attach it to each
of your other jsp's.

<jsp:include page="init_and_utils.jsp"/>


--- "Felix A. Milovanov" <>
>   Hello all,
>   i just started using Java for server-side WEB
> development ( I've 4 years of
> this development in C and Perl ). When I read about
> JSPs, I found than JSP is
> compiled into servlet on a first call and than runs
> like a servlet. 
>   The question is : is it possible to have a
> superclass for my JSPs? I need to
> make some activity before each JSP is called. I made
> a superclass for my 
> servlets, so I cat write my servlets inherited from
> baseServlet and do not worry
> about pre-request activity. But how can I do it for
> JSP???
>   Sincerely,
> 									Felix.

Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.

View raw message