wood burning stoves 2.0*
The moose likes JSP and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark ""code too large for try statement "  , While compiling JSP" Watch ""code too large for try statement "  , While compiling JSP" New topic
Author

"code too large for try statement " , While compiling JSP

venkatreddy gangireddy
Greenhorn

Joined: Feb 26, 2007
Posts: 8
I have a JSP with the size 147kb. When it gets compiled the size is becoming 250kb. I am aware of that there can be 64k of code between try-catch block. But i can't split the jsp and have include one jsp into other, bcoz i am using the XML mapping for my jsp. Can any one please suggest me a solution to avoid the "code too large for try statement " Exception if i increse the JSP size even more.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The generic answer to this problem is to refactor your JSP to get any non markup code out of it. Understanding that this isn't always a small task that can be performed quickly enough to get your application up and running, the usual 'quick fix' is to break the JSP into smaller JSP action includes. If you can't do that, I'm not sure what else can be done.

Can you explain, why it is that you can't break your JSP up into actions in a little more detail?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
venkatreddy gangireddy
Greenhorn

Joined: Feb 26, 2007
Posts: 8
Thanks for your response, Actually i am using XML mapping for every JSP, Depending on one of the field in that XML we are mapping the data to the data base. If i split that JSP, i have to maintain one more XML and updation of Database table will create Unit of transaction problem.
Is there any way to make the weblogic server(weblogic 8.1) to compile the JSP in different try blocks instead of single big try block. (as in Tomcat 5.0, i can't use tomcat since projject requirements are like that).Can any one please suggest me the solution.
anton kurniadi
Greenhorn

Joined: Jun 24, 2009
Posts: 1
use <jsp:include> tag to split your huge size jsp file to smaller jsp files, it will solve your problem
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

DontWakeTheZombies -- that thread is over two years old.
 
jQuery in Action, 2nd edition
 
subject: "code too large for try statement " , While compiling JSP
 
Similar Threads
Getting too large try statement in JSP page
Code size is too large for try catch statement in JSP
reason for this exception
JSP Compilation Error with Weblogic 9.2
code size too large for try catch block in JSP