aspose file tools*
The moose likes Servlets and the fly likes response.setHeader issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "response.setHeader issue" Watch "response.setHeader issue" New topic
Author

response.setHeader issue

ashiek aneez
Greenhorn

Joined: Oct 17, 2008
Posts: 5
Hi All,

I am using WAS 4.0.

EJB

Am trying to download messages from application to a test file.

It is working fine.

Sometimes it is showing some error message as,

TraceNLS No message text associated with key WARNING:.Cannot.set.header..Response.already.committed. in bundle com.ibm.ejs.resources.seriousMessages
SRTServletRes WARNING: Cannot set header. Response already committed.


how should i overcome this issue.

please help me.

thanks.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19757
    
  20

Headers can only be set if nothing has been written to the page yet. Apparantly this is not the case.

Now writing to the page can be done automatically when using JSPs. For instance:
At the end of line 1, a line break is sent to the page already.

Moving to our servlets forum.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
ashiek aneez
Greenhorn

Joined: Oct 17, 2008
Posts: 5
Thanks Tom,

for example,

I assume that this code is working fine for minimal rows (20 - 25).

In Development setup and in testing setup this is working fine.

In production setup, it is working but sometime it gets some error message as


TraceNLS No message text associated with key WARNING:.Cannot.set.header..Response.already.committed. in bundle com.ibm.ejs.resources.seriousMessages
SRTServletRes WARNING: Cannot set header. Response already committed.




Please help me.

thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: response.setHeader issue