Solved

How to reduce size of a compiled page?

Posted on 2002-04-16
8
271 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
session bean client machine 9 53
parse example 13 86
Getting NoSuchMethodError on accessing a spring mvc project 3 147
maven j2ee examles 2 43
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

757 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

23 Experts available now in Live!

Get 1:1 Help Now