Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How to reduce size of a compiled page?

Posted on 2002-04-16
8
Medium Priority
?
286 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
7 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
Industry Leaders: 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 800 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 6

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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Are you a startup company? Being a startup, you may be using shared hosting, or maybe even dedicated hosting. But have you ever given a thought to using cloud computing now? Yes, don’t be surprised, it is possible for startups to opt for cloud compu…
The number of companies understanding the potential of IoT on B2B market is growing with each day. And yet only a small share of IoT developers have managed to equalize incomes and stay competitive in the international market.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Suggested Courses

581 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