Solved

How to reduce size of a compiled page?

Posted on 2002-04-16
8
272 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to access elements of included jsp  from parent jsp's save button 9 21
Lamba in java 8 9 239
session bean client machine 9 57
AlarmClock Challenge 35 145
In 2017, ransomware will become so virulent and widespread that if you aren’t a victim yourself, you will know someone who is.
A customer recently asked me about anti-malware and the different deployment options available for his business. Daily news about cyberattacks, zero-day vulnerabilities, and companies that suffered a security breach made him wonder if the endpoint a…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

914 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now