• Post Reply Bookmark Topic Watch Topic
  • New Topic

Response size

 
Ami Rathore
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am writing content to the response using
res.getOutputStream().write(buffer);
When the content length is less thatn 8192, everything works fine.
But when the content length exceeds this limit the session is lost. Any solutions suggested ?

Thanks.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What exactly do you mean by "the session is lost"?
Since you are using getOutputStream, I assume you are writing binary (not character) data. How are you setting the Content-type and Content-length headers? Is this the only statement that writes to the response?
Bill
 
Ami Rathore
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a link on the web page. Clicking on that link should open a pdf in the browser. When I go back to the home page and click on any link....i get the message that there is no session.
I am not setting any content-type. Only using these statements

byte[] content = os.toByteArray();
res.setContentLength(content.length);
res.getOutputStream().write(buffer);
res.flushBuffer();
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The most likely cause for the session not being found is that the link URL is not part of the web application that created the session. A session is only valid inside the servlet context that creates it.
Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!