[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index] [Home]

"page extends" problem


Hi,

We stick with one very strange problem, running gnujsp 1.0 on both our WinNT and Linux boxes.
Simple JSP pages works just great, no problem at all, but when we start to use <%@ page extends=""%>
tag we found that that pages does not autorealod by server.
What I mean - if you use jsp page like this - everything is perfect, and when you change this page it's automatically
reloaded as it should:

######################## 1.jsp ############################
<HTML>
<BODY>
<H1>JSP test 01 (w/o extends).</H1>

Today is: <%= new java.util.Date() %>

</BODY>
</HTML>
#########################################################

But with page like this, autoreload doesn't work at all:

######################## 2.jsp ############################
<%@ page extends="test.CoreServlet" %>

<HTML>
<BODY>
<H1>JSP test 02. (with extends)</H1>

Today is: <%= new java.util.Date() %>

</BODY>
</HTML>
#########################################################

Here is a CoreServlet:
######################## CoreServlet.java ###################
########## located at D:\HOME\Java\Servlets\test\CoreServlet.java 
package test;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;

public abstract class CoreServlet implements HttpJspPage {
  private ServletConfig config;

  final public void init(ServletConfig config) throws ServletException {
    this.config = config;
    jspInit();
  }

  final public ServletConfig getServletConfig() {
    return config;
  }

  // This one is not final so it can be overridden by a more precise method
  public String getServletInfo() {
    return "A Superclass for an HTTP JSP";
  }

  final public void destroy() {
    jspDestroy();
  }
  
  public void handleExceptions(HttpServletRequest req, HttpServletResponse res,
                             PrintWriter out, Exception e) {}
  

  /**
  * The entry point into service.
  */
  final public void service(ServletRequest req, ServletResponse res)
        throws ServletException, IOException {
  // casting exceptions will be raised if an internal error.
    HttpServletRequest request = (HttpServletRequest) req;
    HttpServletResponse response = (HttpServletResponse) res;
    try
    {
    	initService(request, response);
    	_jspService(request, response);
    }
    catch (ServletException e) { throw e; }
    catch (IOException  e) { throw e; }
    catch (Exception e)
        	{
     		    PrintWriter pw = null;
						try
        		{
        			pw = res.getWriter();
        		}
        		catch (Exception e1) {}
        		handleExceptions(request, response, pw, e); 
        	}
    finally
    {
    	finalizeService(request, response);
    }
  }

  /**
  * abstract method to be provided by the JSP processor in the subclass
  * Must be defined in subclass.
  */
  abstract public void _jspService(HttpServletRequest request,
            HttpServletResponse response) throws ServletException, IOException;

  /**
  * abstract method to do some initialization before serve http
  * request
  */
  public void initService(HttpServletRequest request,
            HttpServletResponse response) throws Exception
  {
  }

  /**
  * abstract method to do some finalization after http
  * request is served
  */
  public void finalizeService(HttpServletRequest request,
            HttpServletResponse response)
  {
  }

  public void jspInit()
  {
  }

  public void jspDestroy()
  {
  }
#########################################################

Here is config files (WinNt+Apache+Jserv 1.0+gnujsp1.0+IBM JDK 1.1.8):
########################  jserv.properties  ##################
wrapper.classpath=D:\jdk\lib\classes.zip
wrapper.classpath=D:\Apache\JServ\ApacheJServ.jar
wrapper.classpath=D:\Java\JSDK\lib\jsdk.jar
wrapper.classpath=D:\Java\jdbc\ORACLE\lib\classes111.zip
#########################################################

########################  root.properties  ##################
repositories=D:\Java\jswdk\lib\servlet.jar
repositories=D:\Java\gnujsp\lib\gnujsp10.jar 
repositories=D:\HOME\Java\Servlets  // here CoreServlet.java located
servlet.gnujsp.code=org.gjt.jsp.JspServlet
servlet.gnujsp.initArgs=checkclass=true,debug=true,usepackages=false,jserv=yes,scratchdir=D:\Apache\jsp-
classes,pagebase=D:\Apache\htdocs,compiler=builtin-javac -classpath %classpath%;%scratchdir%;D:\Java\jswdk\lib
\servlet.jar;D:\Java\gnujsp\lib\gnujsp10.jar;D:\HOME\Java\Servlets -d %scratchdir% -deprecation %source% 
#########################################################

Btw, I think that it's better to move servlet.jar and gnujsp10.jar from "repositories" to "wrapper.classpath",
but in that case it doesn't work at all, with error like this:
******************************************************
Exception while servicing request for /1/2.jsp:
java.lang.NoClassDefFoundError
******************************************************

The same problems on our Linux Box (RedHat+Apache+Jserv 1.0+gnujsp1.0+IBM JDK 1.1.8).
It woild be great, if somebody can give me ideas of what we do wrong. 

Thanks in advance!



Attachment: CoreServlet.java
Description: Binary data

Attachment: 1.jsp
Description: Binary data

Attachment: 2.jsp
Description: Binary data

Attachment: jserv.properties
Description: Binary data

Attachment: root.properties
Description: Binary data