aspose file tools*
The moose likes JSP and the fly likes Code size is too large for try catch  statement in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Code size is too large for try catch  statement in JSP" Watch "Code size is too large for try catch  statement in JSP" New topic
Author

Code size is too large for try catch statement in JSP

MNaresh Kumar
Greenhorn

Joined: Jun 27, 2008
Posts: 3
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 5700. I tried using include file and action jsp include. also its not working. can any one help me.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30324
    
150

MNaresh,
Welcome to JavaRanch!

What kind of things do you have inside your JSP? In particular, do you have any code in there and what does it do? I'm having trouble picturing just HTML being that big. The answer to this will help us suggest a solution.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
MNaresh Kumar
Greenhorn

Joined: Jun 27, 2008
Posts: 3
Yes,These code fetch from so many pages & accumulated in single page.Whn i try to see the display of the page during that time im getting this error.My jsp contain 5500 lines & more.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

Modern JSPs should contain no code, with the code factored out into controllers called prior to the JSP invocation, or code abstracted into custom tags. Perhaps it is time to refactor your code using more modern standards?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
MNaresh Kumar
Greenhorn

Joined: Jun 27, 2008
Posts: 3
Thq for your response still i need a clarification on this,In this page i too use some custom tag(tag lib),but i cannt use it for many places in this page,could you please suggest me solution.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30324
    
150

MNaresh,
Custom tags are fine. Can you give an example of what kind of things you do in the code of your JSP? Accumulating from other pages is fine. That still leaves me with the question of what they do.

You will get more concrete advice if you provide more concrete details about your pages.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Code size is too large for try catch statement in JSP