Solved

How to reduce size of a compiled page?

Posted on 2002-04-16
8
275 Views
Last Modified: 2010-04-01
I'm using JSTL standard tag library together with HP_AS to build a dinamic web site from a DB.
I have developed my page with about 300 lines of html tags and jsp tag from 5 jakarta-tag libraries.(JSTL + string + request + datetime)
When I compile my file from the browser I got this error:

JspPage_actCercaBnProd_jsp_Impl.java:16223: code too large for try statement
                                                  catch( Throwable thr )
        ^
I've reached the max dimension for compiled class page.
There is any method to reduce the dimension of the page without splitting the source code??

The page has to format a simple recordset, and it is not easy to split.
thank you in advance.
Andrea Grittini
0
Comment
Question by:gritto
8 Comments
 
LVL 19

Expert Comment

by:cheekycj
ID: 6944871
why is it not possible to split out the page into various jsp includes for re-usable components.

I don't know how to reduce the actual bytecode, maybe streamlining some of your code will help.  If you post some of your code maybe we can suggest some alternatives.

But breaking the JSP out into other includes would be much easier to maintain and probably a better approach.. as every time you add/modify something in this file, you will deal with this issue.

CJ
0
 

Author Comment

by:gritto
ID: 6944888
I know that is much easier to maintain code when it is splitted, but I have to manage about 15 parameter , then build a SQL suery and then manage the recordset to view the result.
So my first idea was to pass the parameter again to a subpage and build the query and then pass the result to another subpage to view the result.
Can be an idea to set a session variables to use it in the subpages??(I have to delete when I finish)

0
 
LVL 19

Expert Comment

by:cheekycj
ID: 6945201
you can pass the parameters using 3 methods:
JSP params.
Request Attributes
Session vars.

If it is only being used in the current page JSP params or Request Attributes is the optimal way.  If the values are all string then JSP params is the best way.

CJ
0
ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

 

Author Comment

by:gritto
ID: 6945208
I know that is much easier to maintain code when it is splitted, but I have to manage about 15 parameter , then build a SQL suery and then manage the recordset to view the result.
So my first idea was to pass the parameter again to a subpage and build the query and then pass the result to another subpage to view the result.
Can be an idea to set a session variables to use it in the subpages??(I have to delete when I finish)

0
 
LVL 19

Accepted Solution

by:
cheekycj earned 200 total points
ID: 6946015
I would use request or JSP params.. I usually avoid Session vars unless I absolutely need them (I.E) need to store data btw requests.

CJ
0
 
LVL 5

Expert Comment

by:Jan Louwerens
ID: 7022793
Also, if you are using lots of the + String concatenation operators, you might want to use StringBuffer and it's append() function instead.
The reason is that Strings are really meant to be static strings and not dynamic ones, so the + operator actually creates a new String and copies the old strings into it. If many are used in succession, this can also leave a lot of temporary String objects left around waiting to be garbage collected.
If you are using the + operator often, you can see how this might generate a large amount of unnecessary code (as well as up lots of memory).
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 9553255
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

"Accept cheekycj's comment as answer."
 
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Kuldeepchaturvedi
EE Cleanup Volunteer
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SimpleDateFormat.parse examples 19 93
Reading data  from excel sheet and displaying 1 82
Market Place not working in Eclipse Luna 2 112
web application structure 18 77
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This article outlines the process to identify and resolve account lockout in an Active Directory environment.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question