tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Wall <>
Subject Re: JSP too big to compile?
Date Fri, 03 Jun 2005 22:17:42 GMT
The jsp:include is coming very close for us, but we're doing some tricks 
on these JSP pages that are causing us a problem with this approach. 

In the main JSP, we are creating a class inside that has the data 
elements for that page as well as a bunch of custom routines that act on 
the bean data.  In this case, we use a construct like:

public class BeanData
    public String field1;
    public String field2;
    public void method1()
    { .... }

void doSomething(BeanData bean)

This has worked well.  Normally, we'd create a regular bean and use 
jsp:useBean to access it, but we did this so we could just upload the 
JSP and the bean would go together for ease of update without 
restarting, etc.  These JSP pages are bit "special" in that they are 
customer-defined pages that need to be changeable without having to 
upload a new JAR/WAR/.class file and have the application reload. 

Of course, a jsp:include page cannot access the BeanData defined in the 
other page because the BeanData class is nested inside the servlet class 
created from the JSP (even if we pass it as a parameter, the receiving 
end will get a security access exception).

First, is there a better way for a JSP to define a class that could be 
accessed outside of it rather than using the <%! %> mechanism to declare 
the code?  If not, are there any thoughts on how to pass such a private 
bean instance to the jsp:include page so it can also use it?


Pascal Gehl wrote:

>It's a global java limitation.
>You'are limited to around 10 000 lines of code in a try catch block.
>Try to use dynamic includes instead of static includes. 
>Pascal Gehl
>-----Original Message-----
>From: David Wall [] 
>Sent: Friday, June 03, 2005 16:31
>Subject: JSP too big to compile?
>We have a web page that contains many business documents laid out one after
>the other so a user can just click print and have all of them print together
>(with a stylesheet that starts each contract on its own printed page). 
>But we seem to be having an error that the generated servlet code is too big
>because of service method's try block is too long.
>Is there anything I can tweak to allow this to be bigger for the java
>compiler, or is this just a limit of Java in general?
>Generated servlet error:
>    [javac] Compiling 1 source file
>    [javac]
>compiler message file broken: 
>arguments=null, null, null, null, null, null, null
>    [javac]     } catch (Throwable t) {
>    [javac]       ^
>    [javac]
>compiler message file broken: 
>arguments=null, null, null, null, null, null, null
>    [javac]     try {
>    [javac]         ^
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message