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

Getting too large try statement in JSP page

jai KM
Greenhorn

Joined: Aug 22, 2005
Posts: 1
hi

i getting code too large for try statement, when i opening one of my JSP file. File size is around 2000 lines.
Could anybody tell me the reason for that error. is it because of the restriction in java compiler?.
if u have any alternatives let me know...


thanks in advance...

regards,
Daniel Rhoades
Ranch Hand

Joined: Jun 30, 2004
Posts: 186
2000 lines of code in 1 file is obscene!

Separate you code into logical function and put them into other JSP pages - or better yet servlets or tag libraries.


Drinking more tea is the key...
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
If you are not in a position to modularize 2000 line code, try to cover up your existing code with multiple try/catch block.


My blood is tested +ve for Java.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60056
    
  65

"jai KM",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ajay Krihnamurthy
Greenhorn

Joined: Aug 24, 2005
Posts: 8
hi 2000 lines is not a big issue in a jsp page. U can do onething use multipe try{}catch(Exception e){System.out.println(e.getMessage());} with inur jsp code .. From the tomcats log folder u can get the appropriate error message for ur exception



once if u cant sove that error please let me know


hi.. java is not a product it is an Industry
Choon-Chern Lim
Ranch Hand

Joined: Aug 29, 2005
Posts: 74
2000 lines in JSP is not the problem, but it will be a massive problem once you get exceptions. In my past experience, it is difficult to debug the code.

I would suggest you breaking up the codes, where you place your JAVA codes in servlets, your presentations (HTML/JSP tags stuff) in JSP, and your client side script (Javascript) in JS file. At least, when other developer reads your codes, they are not going to get lost in the sea of codes.

Another beauty of having your codes in servlets is that you can easily debug your codes by putting break points in IDEs like Eclipse/WSAD/RAD.

I guess my point is that you want to be able to able to read your own codes in 3 months time.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting too large try statement in JSP page
 
Similar Threads
WAS 4.0 Bug
Code too larger for the try block in Jsp
reason for this exception
code too large for try statement for a JSP to compile
Code size is too large for try catch statement in JSP