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? Thanks, David Generated servlet error: [javac] Compiling 1 source file [javac] /home/tomcat/jakarta-tomcat-4.1.30/work/Standalone/localhost/app/application_jsp.java:8946: compiler message file broken: key=compiler.err.compiler.err.limit.code.too.large.for.try.stmt arguments=null, null, null, null, null, null, null [javac] } catch (Throwable t) { [javac] ^ [javac] /home/tomcat/jakarta-tomcat-4.1.30/work/Standalone/localhost/app/application_jsp.java:1118: compiler message file broken: key=compiler.err.compiler.err.limit.code.too.large.for.try.stmt arguments=null, null, null, null, null, null, null [javac] try { [javac] ^
RE: JSP too big to compile?
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 [mailto:[EMAIL PROTECTED] Sent: Friday, June 03, 2005 16:31 To: tomcat-user@jakarta.apache.org 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? Thanks, David Generated servlet error: [javac] Compiling 1 source file [javac] /home/tomcat/jakarta-tomcat-4.1.30/work/Standalone/localhost/app/application _jsp.java:8946: compiler message file broken: key=compiler.err.compiler.err.limit.code.too.large.for.try.stmt arguments=null, null, null, null, null, null, null [javac] } catch (Throwable t) { [javac] ^ [javac] /home/tomcat/jakarta-tomcat-4.1.30/work/Standalone/localhost/app/application _jsp.java:1118: compiler message file broken: key=compiler.err.compiler.err.limit.code.too.large.for.try.stmt arguments=null, null, null, null, null, null, null [javac] try { [javac] ^ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP too big to compile?
You are actually limited by Java. I can't recall the actual size off hand, but a method can only be so big. From what I remember, it has something to do with server side includes vs jsp includes. We ended up doing some pretty nasty stuff by conditionally doing a server side include. I can't really remember much more than that it was several years ago. David Wall wrote: 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? Thanks, David Generated servlet error: [javac] Compiling 1 source file [javac] /home/tomcat/jakarta-tomcat-4.1.30/work/Standalone/localhost/app/application_jsp.java:8946: compiler message file broken: key=compiler.err.compiler.err.limit.code.too.large.for.try.stmt arguments=null, null, null, null, null, null, null [javac] } catch (Throwable t) { [javac] ^ [javac] /home/tomcat/jakarta-tomcat-4.1.30/work/Standalone/localhost/app/application_jsp.java:1118: compiler message file broken: key=compiler.err.compiler.err.limit.code.too.large.for.try.stmt arguments=null, null, null, null, null, null, null [javac] try { [javac] ^ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP too big to compile?
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? Thanks, David 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 [mailto:[EMAIL PROTECTED] Sent: Friday, June 03, 2005 16:31 To: tomcat-user@jakarta.apache.org 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? Thanks, David Generated servlet error: [javac] Compiling 1 source file [javac] /home/tomcat/jakarta-tomcat-4.1.30/work/Standalone/localhost/app/application _jsp.java:8946: compiler message file broken: key=compiler.err.compiler.err.limit.code.too.large.for.try.stmt arguments=null, null, null, null, null, null, null [javac] } catch (Throwable t) { [javac] ^ [javac] /home/tomcat/jakarta-tomcat-4.1.30/work/Standalone/localhost/app/application _jsp.java:1118: compiler message file broken: key=compiler.err.compiler.err.limit.code.too.large.for.try.stmt arguments=null, null, null, null, null, null, null [javac] try { [javac] ^ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JSP too big to compile?
you can us includes and then delete the compiled file in the work directory. So split page up by using %@ include file=checklogin.jsp % for each block of general code coded in a include jsp. After upload delete the file in the work directory, so compilation is done at runtime of tomcat. And its working..for me it do. Maarten -Oorspronkelijk bericht- Van: David Wall [mailto:[EMAIL PROTECTED] Verzonden: zaterdag 4 juni 2005 0:18 Aan: Tomcat Users List Onderwerp: Re: JSP too big to compile? 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? Thanks, David 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 [mailto:[EMAIL PROTECTED] Sent: Friday, June 03, 2005 16:31 To: tomcat-user@jakarta.apache.org 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? Thanks, David Generated servlet error: [javac] Compiling 1 source file [javac] /home/tomcat/jakarta-tomcat-4.1.30/work/Standalone/localhost/app/applicatio n _jsp.java:8946: compiler message file broken: key=compiler.err.compiler.err.limit.code.too.large.for.try.stmt arguments=null, null, null, null, null, null, null [javac] } catch (Throwable t) { [javac] ^ [javac] /home/tomcat/jakarta-tomcat-4.1.30/work/Standalone/localhost/app/applicatio n _jsp.java:1118: compiler message file broken: key=compiler.err.compiler.err.limit.code.too.large.for.try.stmt arguments=null, null, null, null, null, null, null [javac] try { [javac] ^ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.322 / Virus Database: 267.5.1 - Release Date: 2-6-2005 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.322 / Virus Database: 267.5.1 - Release Date: 2-6-2005 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]