You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Eric Gilbertson <er...@pervasivesec.com> on 2002/08/17 02:07:53 UTC

get blank pages when using precompiled JSPs (jspc problem?)

Hello Tomcaters:

can anyone tell me why a JSP that works when dynamically compiled
would generate a blank page when statically compiled using jspc?
the jsp class file is generated via the ant task listed below and packaged
into a .war file. everything appears to build okay and yet when i hit the
page  nothing is returned. i know that the class file is  hit because the
return status is "200" and i see my debug statements
  on stderr.

the only differences between the statically and dynamically generated files
are the packages, e.g. org.apache.jsp vs. com.secretseal.... and the class
name, e.g. foobar vs foobar$jsp.  i suspect that the problem has to do with
different runtime support for the two versions, e.g. for some reason the text
generated by the statically compiled version is being directed to the bit 
bucket.

suggestions as to how to resolve this problem are greatly appreciated.

sincerely,

eric gilbertson
eric.gilbertson@secretseal.com



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: get blank pages when using precompiled JSPs (jspc problem?)

Posted by Eric Gilbertson <er...@pervasivesec.com>.
Hello Again:

I've traced my precompiled JSPs not responding problem down to the following
statement returning null:

             _jspxFactory = JspFactory.getDefaultFactory();

Since this a boiler plate jsp statement that does work when the JSPs are 
dynamically
compiled, it seems to me that there is a problem in my runtime environment 
that is
preventing the default factory from being set when the JSPs are statically 
compiled.
Any suggestions as to what could be causing this problem would be greatly 
appreciated.

Environment = Tomcat 4.0.4 on  Windows XP, ant compile task listed below.

TIA,

Eric Gilbertson
eric.gilbertson@secretseal.com


Ant task used to compile JSPs:
     <target name="compile-jsp" depends="init">
         <delete dir="${ADMIN_RESOURCES}" quiet="true"/>
         <delete dir="${GEN}"/>
         <mkdir dir="${CLASS-WAR}"/>
         <mkdir dir="${GEN}"/>
         <java fork="true" classname="org.apache.jasper.JspC">
             <arg line="-d temp" />
             <arg line="-p ${PACKAGE}" />
             <arg line="-webxml adminpages/WEB-INF/web.xml" />
             <arg line="-webapp ${SRC_DIR}webadmin/adminpages"/>
             <classpath>
                 <pathelement path="${CLASSES_DIR}"/>
                 <path refid="common.class.path"/>
                 <pathelement location="${LIB_DIR}/jasper-compiler.jar"/>
                 <pathelement location="${LIB_DIR}/jasper-runtime.jar"/>
             </classpath>
         </java>




At 05:07 PM 8/16/2002 -0700, tomcat-user@jakarta.apache.org wrote:
>Hello Tomcaters:
>
>can anyone tell me why a JSP that works when dynamically compiled
>would generate a blank page when statically compiled using jspc?
>the jsp class file is generated via the ant task listed below and packaged
>into a .war file. everything appears to build okay and yet when i hit the
>page  nothing is returned. i know that the class file is  hit because the
>return status is "200" and i see my debug statements
>  on stderr.
>
>the only differences between the statically and dynamically generated files
>are the packages, e.g. org.apache.jsp vs. com.secretseal.... and the class
>name, e.g. foobar vs foobar$jsp.  i suspect that the problem has to do with
>different runtime support for the two versions, e.g. for some reason the text
>generated by the statically compiled version is being directed to the bit 
>bucket.
>
>suggestions as to how to resolve this problem are greatly appreciated.
>
>sincerely,
>
>eric gilbertson
>eric.gilbertson@secretseal.com



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: get blank pages when using precompiled JSPs (jspc problem?)

Posted by Eric Gilbertson <er...@pervasivesec.com>.
it turns out that the problem was simply that the JSP servlet was
not registered in the web.xml file being generated by jspc. simply
putting the servlet-mapping entry for jsps back in resolved the problem.

seems like a bug to me that jspc doesn't include this entry given that it
is required to run jsp derived servlets. also would have helped if tomcat
threw an exception under this case rather than returning a null JspFactory.

regards,

eric gilbertson


At 05:07 PM 8/16/2002 -0700, tomcat-user@jakarta.apache.org wrote:
>Hello Tomcaters:
>
>can anyone tell me why a JSP that works when dynamically compiled
>would generate a blank page when statically compiled using jspc?
>the jsp class file is generated via the ant task listed below and packaged
>into a .war file. everything appears to build okay and yet when i hit the
>page  nothing is returned. i know that the class file is  hit because the
>return status is "200" and i see my debug statements
>  on stderr.
>
>the only differences between the statically and dynamically generated files
>are the packages, e.g. org.apache.jsp vs. com.secretseal.... and the class
>name, e.g. foobar vs foobar$jsp.  i suspect that the problem has to do with
>different runtime support for the two versions, e.g. for some reason the text
>generated by the statically compiled version is being directed to the bit 
>bucket.
>
>suggestions as to how to resolve this problem are greatly appreciated.
>
>sincerely,
>
>eric gilbertson
>eric.gilbertson@secretseal.com



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>