Please join us at the new JavaWorld Q&A Forums. Your existing login will work there. The discussions here are now read-only.


JavaWorld Talkback >> 960412

Pages: 1
Subbu Allamaraju
Unregistered




Content-Length example
      #25598 - 01/05/06 11:23 AM

Jason - your Content-Legth example puzzled me.

In HTTP1.1, the Content-Length on a response refers to the entity length and transfer length. Both apply to the body of the response, and exclude headers.

So, it should be perfectly leagal to say

response.setHeader("Host", "localhost");
response.setHeader("Pragma", "no-cache");
response.setHeader("Content-Length", "0");
response.setHeader("Location", "http://www.apache.org");

The client should then receive four headers with no response body.

The servlet spec is free to say that the response should be closed after the third header, but it seems quite odd to specify such behavior.

Subbu Allamaraju


Post Extras: Print Post   Remind Me!   Notify Moderator  
vinautieri
stranger


Reged: 10/28/07
Posts: 2
Re: Content-Length example [Re: Subbu Allamaraju]
      #59885 - 10/28/07 06:49 PM

hey i need some help with java and finding min and max with arrays through methods.. think you can help?

Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 1 anonymous users are browsing this forum.

Moderator:   

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 13587

Rate this topic

Jump to

Contact us JavaWorld

Powered by UBB.threads™ 6.5.5