15 Configuring Character Encoding 93
2.15 Configuring Character Encoding
The locale and character encoding of the servlet response can be set explicitly by calling
setLocale in combination with the setContentType and setCharacter-
Encoding methods of the HttpServletResponse object. If only the setLocale
method is called, the character encoding used for the explicitly set locale is server dependent.
For portability and convenience, the character encoding to be used for the particular
locale can be specified in web.xml with the use of locale-encoding-mappinglist.
The locale-encoding-mapping-list element is a subelement of the
root web-app element, and contains one or more locale-encoding-mapping
elements. The locale-encoding-mapping element contains the locale and
encoding elements as follows:
ja
Shift_JIS
he
windows-1255
2.16 Designating Application
Event Listeners
Application event listeners are classes that are notified when some event in the Web
application life cycle occurs. Examples of life-cycle events would include a notification
when the servlet context or a session object is created or modified. There are
other life-cycle events that have listener classes associated with them.
Pages:
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137