Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
venkatreddy gangireddy
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
venkatreddy gangireddy
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use <jsp:include> tag to split your huge size jsp file to smaller jsp files, it will solve your problem
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DontWakeTheZombies -- that thread is over two years old.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic