A better approach would be to have those global methods packaged in a bean
and use the bean with the jsp insteading of extending the jsp from the
Servlet Class.
extending a jsp from a different class does limit the ability of the Jsp
Engine to improve the execution speed of the compiled jsp servlet as far as
my knowledge and practice goes i avoid extending a jsp.
But thats just my humble opinion :-).
Have a nice day.
With regards,
Sachin S. Khanna.
www.emailanorder.com
----- Original Message -----
From: Stefan Henke <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, September 23, 2000 11:13 PM
Subject: problem with "extends" directive


> Hi,
>
> first, I´m new to this list. So please apologize if this is a silly
> question.
>
> I´m using JSP with Tomcat adapted to an Apache server.
>
> I wrote a little servlet which offers some global methods during a
session.
> Now I want to use the "extend"-directive within a jsp-page to have the
> possibility to invoke these methods. The problem is that always the
"doGet"
> method of the servlet is invoked and the actual jsp-page isn´t processed.
Is
> it possible, that the "doGet" is ignored or maybe can I jump to the actual
> jsp-page within the "doGet"-method?
>
> Below you can see my example.
>
> <%@ page extends="myServlet"%>
> <html>
> <title>MyJSPPage</title>
> <body>
> <p>
> This is the JSPPage
> </body>
> </html>
>
> import javax.servlet.*;
> import javax.servlet.http.*;
> import java.io.*;
> import java.util.*;
>
> public class myServlet extends HttpServlet {
>
>   file://Initialize global variables
>   public void init(ServletConfig config) throws ServletException {
>     super.init(config);
>   }
>
>   file://Process the HTTP Get request
>   public void doGet(HttpServletRequest request, HttpServletResponse
> response) throws ServletException, IOException {
>     PrintWriter out = response.getWriter();
>     response.setContentType("text/html");
>     out.println("<html><title>MyJSPPage</title>");
>     out.println("<body>This is my servlet</body></html>");
>     out.close();
>   }
> }
>
>
> Maybe you can help me?
> Thanks
> Stefan
>
> [EMAIL PROTECTED]
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to