Here is what we are doing at Cambridge Interactive with Resin.  It works
correctly though it bypasses Resin's optimizations. We are porting from a
JSP 0.91 version though so we are willing to take that hit (temporarily I
hope). It isn't a recommended design though. You could be losing a lot of
performance tweaks by using the extends page directive with JSP 1.x.

public abstract class CIServlet
  extends javax.servlet.http.HttpServlet
  implements HttpJspPage, SingleThreadModel
{
  public abstract void _jspService(
                         HttpServletRequest request,
                         HttpServletResponse response )
    throws ServletException, IOException;

  public void jspDestroy()
  {
  }

  public void jspInit()
  {
  }

  public synchronized void service(
                             HttpServletRequest request,
                             HttpServletResponse response )
    throws ServletException, IOException
  {
    _jspService( request, response );
  }
}

Jim Bailey
<mailto:[EMAIL PROTECTED]>
<http://www.cinteractive.com>

-----Original Message-----
From: �arendra Acharya [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 27, 2000 10:02 AM
To: [EMAIL PROTECTED]
Subject: URGENT : How do i extend a JSP page ?


Hi everybody,

I'm trying to extend my own class using a JSP.
The spec says that the superclass:
1. should implement HttpJspPage
2. al the methods in the Servlet interface are declared final

additionally, JSP author should have in the superclass :
- the service() method of the Servlet API invoke the _jspService()
- init(ServletConfig) method stores the configuration, makes it =
available as getServletConfig, then invokes jspInt
- the destroy() method invokes jspDestroy

now i'm using JRUN and i just checked out the .java file created by it :
it has the following signature:
public class myacct extends com.livesoftware.jsp.HttpJSPServlet =
implements com.livesoftware.jsp.JRunJspPage, HttpJspPage=20
Can somebody please tell me if i have to have my own superclass :
1. What class should my super class extend ? (in the context of using =
JRUN)
2. what classes should my super class implement ? (in the context of =
using JRUN)
3. What should be there in the init()/destroy() method ? (in the context =
of using JRUN)
3.1 by default
3.1 in case i don't have to initialize/destroy any objects for my =
project

Many thanx in advance

regards
narendra
P.S. i tried to send this mail twice using Outlook Express but it was
returned back
saying that this mail contained an attachment ..??? anybody know if Outlook
Express somehow "attaches" anything ?

===========================================================================
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