"code too large for try statement " , While compiling JSP
Joined: Feb 26, 2007
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.
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?
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.
Joined: Jun 24, 2009
use <jsp:include> tag to split your huge size jsp file to smaller jsp files, it will solve your problem