velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chenjian <>
Subject #parse() and UTF-8 response encoding problem
Date Fri, 11 Jun 2004 03:35:28 GMT

In my web application, I have a Controller servlet which extends Velocity 
Servlet. In the Controller servlet, I have

// set the request/response encoding once and for all 
response.setContentType("xxxxxxx; charset=UTF-8"); 

This has been working great, the web page rendered is in UTF-8. However, today 
I modified the template so that the common parts get extracted. So, instead of

header stuff
body content
footer stuff

I have

body content

But, when I run the web app, the browser displays two weird characters in the 
web page. When I looked at the page source, the stuff in header.vm gets 
rendered with newline stripped off. So there is no newline which was in the 
header.vm. When I took the response.setxxxx() encoding off and run the app 
again, the web page was good again.

So, I guess the encoding messed up the #parse() somehow. But could not figure 
this out. Any help is greatly appreciated!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message