tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Burman" <richard.bur...@ardentia.co.uk>
Subject RE: Pre-compiled JSPs?
Date Tue, 06 Sep 2005 15:06:51 GMT
Hi Tim,

Yeah, that's my exact issue, except the pages somewhat more complicated
than your example. ;o)

I've tried renaming one of them to jspf and, unsurprisingly, it has been
ignored by the JSP compiler. I'll have to take your word that it would
still work in the parent (once the reference had been changed to point
to jspf, not jsp) as I don't have a test bed up and running at the
moment.

Okay, so we've ascertained how to avoid the 'fragments' being compiled
because they're effectively not valid JSP pages because they use beans
that are never declared within themselves. The 'parent' page will
compile because it has all it needs to be compiled but the fragment
cannot be compiled without the presence of the parent. Does this mean
that I can only include the 'parent' JSPs in my JAR file and included in
my web.xml? Do I have to keep the fragments as raw JSPs in my webapp,
then? I'd really rather get them all together in a JAR, if possible,
which is why I'm on this voyage of discovery! :o)

I really appreciate your help with this.

Regards,
Richard.

-----Original Message-----
From: Tim Funk [mailto:funkman@joedog.org] 
Sent: 06 September 2005 15:57
To: Tomcat Users List
Subject: Re: Pre-compiled JSPs?

For example:

File a.jsp
<% String worldVar = null; %>
<%@include file='b.jsp'%>
Hello  <%=worldVar%>

File b.jsp
<%worldVar = "world"%>


Notice b.jsp will not precompile. But then again - no one should be
calling 
b.jsp since its not a jsp - its a jsp fragment. It should be calld
b.jspf.

I am guessing - your pages have a similar issue.

-Tim


Richard Burman wrote:

> Sorry, I don't understand. How will my JSP compile at all if a section
> (fragment) is ignored and, presumably, omitted from the resulting java
> file?
> 
> -----Original Message-----
> From: Tim Funk [mailto:funkman@joedog.org] 
> Sent: 06 September 2005 15:05
> To: Tomcat Users List
> Subject: Re: Pre-compiled JSPs?
> 
> errorOnUseBeanInvalidClassAttribute (IIRC) is a test when jsp:useBean
is
> used 
> without a default constructor being available.
> 
> If you are using include files which were as meant as compile time
> include 
> fragments, rename them (the include files) to jspf and they will be
> ignored 
> by the jsp compiler.
> 
> -Tim
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message