Occasionally, when I try to send an object to my servlet, I get the 
message "413:  Request entity is too large", and the request never seems 
to get into the servlet code.

Is there anything I can do to change the size of acceptable objects? 
How would I chunk my output object to make it more acceptable?

Here is the code I'm using to write from my java application to the 
servlet.   This doesn't throw an exception, but I get the error I 
mentioned above as the return, instead of the object I'm expecing.

URL serverURL = new URL("http://"+parmsServer+"/ObjectServlet";);
servletConnection = serverURL.openConnection();
if (sessionID != null)
{
        servletConnection.setRequestProperty( "Cookie", sessionID);
}

// Don't use a cached version of URL connection.
servletConnection.setUseCaches (false);
servletConnection.setDefaultUseCaches (false);

servletConnection.setAllowUserInteraction(false);
servletConnection.setDoInput(true);

servletConnection.setDoOutput(true);

ObjectOutputStream outputToServlet = new
ObjectOutputStream( new BufferedOutputStream( 
servletConnection.getOutputStream()));
        
outputToServlet.writeObject( inParms);
outputToServlet.flush();
outputToServlet.close();

Thanks in advance,
Roxanne


Reply via email to