tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Schulte <andre.schu...@valtech.de>
Subject Overwritten or ignored ContentType by setContentType
Date Tue, 04 Mar 2008 10:38:45 GMT
Hello,

I use the Tomcat 6.016 on unix

Following Problem. I set the contenttype in the Response 
setContentType("application/xhtml+xml; charset=ISO-8859-1") and log 
directly the Contenttype but it is null by calling getContentType()

Why is the ContentType overwritten or maybe ignored by invoking the 
setContentType("application/xhtml+xml; charset=ISO-8859-1") ?

log:

2008-03-04 09:59:57,241 DEBUG  (... XMLTransformer) : TRANSFORMER - Get 
original ContentType from Response null
2008-03-04 09:59:57,241 DEBUG (...XMLTransformer) : Content type: 
application/xhtml+xml; charset=ISO-8859-1
2008-03-04 09:59:57,241 DEBUG  (...XMLTransformer) : TRANSFORMER - Set 
ContentType to Response null
2008-03-04 09:59:57,241 DEBUG  (...XMLTransformer) : SessionId: 
6E539DCC66D0D8EFAA0ED1DAE3C55824
2008-03-04 09:59:57,242 ERROR  (...XMLTransformer) : Failed to set 
Contentype in Response

code:

log.debug("TRANSFORMER - Get original ContentType from Response " + 
res.getContentType());

log.debug("Content type: " + ServiceConstants.CONTENTTYPE_XHTML);

res.setContentType(ServiceConstants.CONTENTTYPE_XHTML);

log.debug("TRANSFORMER - Set ContentType to Response " + 
res.getContentType());

log.debug("SessionId: " + req.getSession(false).getId());

if (res.getContentType() == null) {

log.error("Failed to set Contentype in Response");

}

if (Utilities.CHARSET_ENCODING != null)

res.setCharacterEncoding(Utilities.CHARSET_ENCODING);

// ServletOutputStream out = res.getOutputStream();

PrintWriter out = res.getWriter();

...

Thank for your help,

Cheers,

Andre

-- 
André Schulte
Senior Consultant
mailto:andre.schulte@valtech.de
Mobile: +49 (0)172 3042664

Valtech GmbH
Bahnstraße 16
40212 Düsseldorf
Germany

Phone: +49 (0)211 179237-0
Fax: +49 (0)211 179237-19

http://www.valtech.de

Geschäftsführer: Ingo Kriescher
Amtsgericht Düsseldorf HRB48672

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message