From: Aj-India on
Hi,
I am using JSP. I got this error" The code of method
_jspService(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse) is exceeding the 65535 bytes
limit ". Is there any way around this? I am now in a position that I
cannot reduce my number of lines of code.
Thx,
Aj

From: Jimi Hulleg?rd on
"Aj-India" <ajitravindran(a)gmail.com> wrote in message
news:1125934051.843610.224970(a)g14g2000cwa.googlegroups.com...
> Hi,
> I am using JSP. I got this error" The code of method
> _jspService(javax.servlet.http.HttpServletRequest,
> javax.servlet.http.HttpServletResponse) is exceeding the 65535 bytes
> limit ". Is there any way around this? I am now in a position that I
> cannot reduce my number of lines of code.

Apparently this is a limit in the java language. Try to move some of the
code to another jsp-file, and do an <jsp:include>.

/Jimi


From: Andrea Desole on


Aj-India wrote:
> Hi,
> I am using JSP. I got this error" The code of method
> _jspService(javax.servlet.http.HttpServletRequest,
> javax.servlet.http.HttpServletResponse) is exceeding the 65535 bytes
> limit ". Is there any way around this? I am now in a position that I
> cannot reduce my number of lines of code.

you have to. This message means that you have a very long jsp, which is
translated into a service method that is longer than 64k, which violates
the specification of the JVM.
You can solve the problem reducing the size of the method, for example
you can split the page in fragments and dynamically include them, or use
custom tags.
This message also means, by the way, that you probably have a *very*
long jsp, which means that you should do that anyway
From: Roedy Green on
On 5 Sep 2005 08:27:31 -0700, "Aj-India" <ajitravindran(a)gmail.com>
wrote or quoted :

>_jspService(javax.servlet.http.HttpServletRequest,
>javax.servlet.http.HttpServletResponse) is exceeding the 65535 bytes
>limit ". Is there any way around this? I am now in a position that I
>cannot reduce my number of lines of code.

"The 65535 limit" can you find out for sure just what limit they are
talking about? That is NOT the Java String size limit. It is a limit
on method size and possibly class size. It might be some limit on the
size of the response.

Assuming it is the size of the method, you must be doing something
quite unusual that you "cannot" reduce the number of lines of code.

There is no way you could write a fatter method since the class file
jump offsets are 16 bits in a method.

You have not shown us the sample code, so I can only talk in
generalities.

Possibly the problem is the initialisation of some huge table.
1. split that off into some separate class.
2. build it offline and serialise it, so all you need is a readObject
to get it back.

Study the code for any sort of encapsulation.

Simply chop the method in two, and call each half with a huge number
of parameters.

Build the method directly in byte code, where perhaps you can be more
efficient than JavaC. See http://mindprod.com/jgloss/jasm.html

Perhaps this class is a DEBE, does everything but eat. Split some of
the functionality off into a different class.

Presumably this class started out as JSP. Consider having part of the
page generated by a different class then inserted.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
From: Robert Klemme on
Aj-India <ajitravindran(a)gmail.com> wrote:
> Hi,
> I am using JSP. I got this error" The code of method
> _jspService(javax.servlet.http.HttpServletRequest,
> javax.servlet.http.HttpServletResponse) is exceeding the 65535 bytes
> limit ". Is there any way around this? I am now in a position that I
> cannot reduce my number of lines of code.

I bet you can. Try using <jsp:include> as suggested earlier, make use of
tag libs and generally increase the modularity of your code.

robert