Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Code Too large

 
navi kumar
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 93
Mac Objective C Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
navi kumar
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Those are static includes.
They do nothing more than a code merge before compilation.
See:
http://faq.javaranch.com/view?IncludesActionDirective
 
navi kumar
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because, I am getting the following error
weblogic.utils.ParsingException: Could not complete parsing, unmatched tags: form
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic