Hello Stefan,
I am not very experienced at this either but I would have extended with a regular
bean instead of a servlet. I hope this helps.
Brad Webb

Stefan Henke wrote:

> 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 {
>
>   //Initialize global variables
>   public void init(ServletConfig config) throws ServletException {
>     super.init(config);
>   }
>
>   //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