aspose file tools*
The moose likes JSP and the fly likes Code Too large Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Code Too large" Watch "Code Too large" New topic
Author

Code Too large

navi kumar
Ranch Hand

Joined: May 10, 2006
Posts: 47
Hi all,

I have changed 3 existing text fields into select fields in my JSP.

For ex:
<td>id</td>
<td>
<html:select name="FormBean" property="id">
<htmlptions name="FormBean" property="idList"/>
</html:select>
</td>

simlarly there are 3 such fields in my JSP. And the result: Code too large error

code too large
public void _jspService(javax.servlet.http.HttpServletRequest request,
^
javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException

Already My JSP is two parts. Again I did split the JSP into one more part making it 3 parts. But in Vain! No use.
Rusty Smythe
Ranch Hand

Joined: Aug 09, 2006
Posts: 93

Hmmm. Something doesn't look right. What data are you trying to pass to your option?

You might also check out How to use <htmlptions>.
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
That's quite possible if you have some monster JSP.

Java classfiles can contain at most 64KB compiled code per method, and the entire content of a JSP (except methods declared in header scriptlet blocks) is compiled into the service method of the generated classfile.

Split up that JSP, such errors are always an good indication of extremely bad design, usually some sort of God class.


42
navi kumar
Ranch Hand

Joined: May 10, 2006
Posts: 47
hi
thanks for your replies.

As i said, i am using htmlptions and also the jsp is splitted into 3 parts.

fortunately, it is working at the moment , when I moved the javascript functions to seperate javascript file. there were some 3 of them left in the jsp. so moved to .js file. Now it is o.k

But, what if it happens in future again, when we are required to add few more fields(some drop downs, etc) , the same problem will be there again for sure. Some solution should be there right? any suggestions? help out please
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
The ONLY solution is redesigning the JSP to create a smaller classfile.
Either use dynamic includes rather than static includes, or divide it up into multiple JSPs and let the controller choose which to call if it's the typical God JSP with tons of conditional code to have it render in many different ways depending on parameters.
navi kumar
Ranch Hand

Joined: May 10, 2006
Posts: 47
hi, thanks for reply..I am dividing the JSP into multiple parts...

Say like this

<%@ include file="/jsp/f1/applic/record_II.jsp"%></td>
<%@ include file="/jsp/f1/applic/record_III.jsp"%></td>

I am adding this lines at the end of the first page inside the <body> tags.

Still no use. Could some one suggest how to do that? I mean how to split into multiple jsp's and let controller know which to call?

Regards
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Those are static includes.
They do nothing more than a code merge before compilation.
See:
http://faq.javaranch.com/view?IncludesActionDirective


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
navi kumar
Ranch Hand

Joined: May 10, 2006
Posts: 47
Hi Ben, thanks for reply.

I have few doubts with Include Action.

I am using an external Javascript file. which i am calling into parent jsp like <script src="/scripts/left.js" language="javascript" type="text/javascript"></script>

Also, I am importing several taglibs like html, logic..etc

DO i need to do all these stuff in the child JSP( the jsp which was split from parent jsp) when I do Include Action. Beacause, it says "The included page must be able to be run on its own. "

Also, possible could you elaborate on "Pages can conditionally be included at run time."

regards
navi kumar
Ranch Hand

Joined: May 10, 2006
Posts: 47
Because, I am getting the following error
weblogic.utils.ParsingException: Could not complete parsing, unmatched tags: form
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Code Too large