1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.chain.web.servlet;
17
18
19 import java.util.Locale;
20 import javax.servlet.http.HttpServletResponse;
21 import org.apache.commons.chain.Context;
22 import org.apache.commons.chain.web.AbstractSetLocaleCommand;
23
24
25 /***
26 * <p>Concrete implementation of {@link AbstractSetLocaleCommand} for
27 * the Servlet API.</p>
28 */
29
30 public class ServletSetLocaleCommand extends AbstractSetLocaleCommand {
31
32
33
34
35
36 /***
37 * <p>Establish the specified <code>Locale</code> for this response.</p>
38 *
39 * @param context The {@link Context} we are operating on.
40 * @param locale The Locale for the request.
41 */
42 protected void setLocale(Context context, Locale locale) {
43
44 HttpServletResponse response = (HttpServletResponse)
45 context.get("response");
46 response.setLocale(locale);
47
48 }
49
50
51 }