miguel angel rojas aquino:
we are developing a web app using jbuilder 8 and struts 1.0.2 (the jbuilder version), and in a certain page we have a number of logic tags to determine the control to show, a <html:text...> or a <html:hidden...> based on the values of some parameters.
the number of tags to do this is about 17 for each property (13) and some logic tags to control the buttons that would be in the form, so maybe there are about 250 logic tags, and when we try to access this page, tomcat shows an error page
I think it's not a limit on the number of tags. It's a limit on the number of lines of the corresponding _jspService method. Your compiled servlet must have a _jspService with quite a few hundreds (maybe thousands?) of lines.
AFAIK, you have a few options: 1) Switch to a better compiler (i've heard there's an IBM compiler wich allows a method to have more lines). But I don't know exactly how to do this.
2) Give up and slice up your JSP into smaller pages (maybe Tiles can help here?)
3) Condense some of the tag's work into an utility method somewhere. For example, if you use lots of tags to determine if a button should be shown or not, move that code into some method and use only the result of that code.
Sounds like you may be doing a lot with the logic tags, perhaps more than a finely grained logic tag should be supporting? Perhaps you might consider writing your own set of tags that might be more closely aligned with your business requirements.
For example, in one project, we came up w/ a set of tags that would display various form components based on user privileges. Doing this via the logic tags turned out to be burdensome, so instead we had something like:
Show form information <myapp:permsrequired permissions="abc,def,ghi"> ["submit"]["delete"] </myapp:permsrequired>
Anyway, it made the presentation pages much cleaner to work with..
I think that you should upgrade tomcat to at least 4.1.18. tomcat 4.0 compiles everything into 1 method _jspService. This was fixed in 4.1 by redesigning jasper.
If it is really a problem of huge _jspService - method and you are not able to upgrade (may be using the newest jspCompiler of BEA weblogic 8.1 ), dynamic includes of smaller JSPs could help. We`ve solved our more-than-65535-compiled-bytes-problem in this way.