Solved

How to reduce size of a compiled page?

Posted on 2002-04-16
8
277 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Display the newly inserted values 3 88
maven webservice example issue 2 166
junit example issue 2 52
dao vs facade design patterns 2 65
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
A big percent of today’s marketing activity is performed through the online environment. The marketing strategies that have existed a decade ago no longer relate to what’s happening today. We’re currently facing a revolutionary era, called the digit…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

738 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