Results 1 to 3 of 3
  1. #1
    dickydevry is offline Member
    Join Date
    Aug 2010
    Posts
    1
    Rep Power
    0

    Default The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding

    I have tomcat 5.5.30 with jdk 1.4.2_21, and i have jsp file then when i hit it i found this error message :

    Unable to compile class for JSP:


    An error occurred at line: 163 in the generated java file
    The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit

    but when i used tomcat 4.1.30 with jdk 1.4.2_21, the problem didn't occur. Please help me what was going on.

    Thank you in advance

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    5

    Default

    its possible the current version of tomcat jsp compiler (that is translating the .jsp page into .java file) is creating more chatter or verbose coding things, than the previous servlet spec, enough so that this is causing the total size of the stuff to be more than 64k, which is apparently an upper limit on the size of stuff that can go into a method (jsp page content goes into the body of the service() method )

    And this amount of content was likely just within this threshold before and worked unnoticed.

    Or that you now have more data than before.

    You must have a very large page? I have never heard of this limit coming up from normal page use.

    I can imagine this happening as the result of the <%@ include %> directive being done inside a for loop. where it is verbatim including that include file. in this case, try to use the <jsp:include> directive instead, as this performs a subroutine type of call out to the include instead of stuffing it verbatim into the generated servlet.

    or perhaps database results rendered inside a for loop. in which case, also try a jsp:include for each row of results, or perhaps limit the size of data using pagination techniques.

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,856
    Rep Power
    19

    Default

    The actual data being processed shouldn't have an effect, as that won't affect the size of code produced by Tomcat. That is, the amount of data returned by a database call is irrelevant.

    Similarly, a loop with a <%@ include %> inside it should have no effect, at least not any different to an include outside a loop. It will only be included once in the generated code, inside the supplied loop.

    So essentially, I would say their JSP page is faaaaaar too much of a monster and should have been borken down, using <jsp:include> as you suggest.

Similar Threads

  1. How to get content from HttpServletResponse
    By sumved.shami in forum Java Servlet
    Replies: 4
    Last Post: 02-02-2012, 04:58 AM
  2. Replies: 6
    Last Post: 06-24-2010, 07:45 AM
  3. Replies: 0
    Last Post: 01-28-2008, 09:00 AM
  4. Replies: 0
    Last Post: 11-06-2007, 06:58 AM
  5. HttpServletRequest request size
    By Ed in forum Java Servlet
    Replies: 2
    Last Post: 07-02-2007, 02:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •