Servlet i18n sample

Servlet 2.4 new features

Prior to Servlet 2.4, the only method to set the character set for the response object was to use ServletResonse.setContentType. In Servlet 2.4, the new method,ServletResponse.setCharactersetEncoding is introduced. This is alternative way to specify the character set of the resonse object explicitly.

Servlet 2.4 also allows to specify the character set of the response object in the implicity way by setting the locale of the response object by calling ServletResponse.setLocale. In this implicit method, locale charset mapping is specified in web.xml.

In this sample, we'll show you how to set response object's character set in both explicitly and implicitly.

Back to sample home

Copyright (c) 2004 Sun Microsystems, Inc. All rights reserved.