• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

code size too large for try catch block in JSP

 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi JSP Developers,

I am getting this error in JSP of "code size too large for try catch block" and when I looked into the compiled java file it has this huge block of code translated from the included JSPs inside of a try catch block.

The lines of code for this JSP is 4500. I tried using include file and action jsp include. also its not working. can any one help me.

I read on website that we can configure it on Weblogic server in the xml file. But i am Using TOMCAT. Can any one help me in this.

I was wondering if there is something wrong I am doing in the way I am including the JSPs..

is there any approach to address this problem of code size too large in JSP Any experience with the same problem or insights into the same is appreciated.

Thanks! (in anticipation),
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That much code in a single JSP is usually a sign that some refactoring needs to be done.

How are you including files with the JSP directive (<%@...) or with a JSP action (<jsp:include.. )?

The former merges the code before compiling which will do you no good in this case. The latter is executed as a separate servet. the results are then merged at run time with its host page.
 
Nilesh Raje
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes i tried both compile time and run time include. Bascially its loads of logic struts tag.!
 
reply
    Bookmark Topic Watch Topic
  • New Topic