KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > web > servlet > view > tiles > TilesJstlView


1 /*
2  * Copyright 2002-2005 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.springframework.web.servlet.view.tiles;
18
19 import javax.servlet.http.HttpServletRequest JavaDoc;
20
21 import org.springframework.context.MessageSource;
22 import org.springframework.web.servlet.support.JstlUtils;
23
24 /**
25  * Specialization of TilesView for JSTL pages; Tiles pages that
26  * use the JSP Standard Tag Library.
27  *
28  * <p>Exposes JSTL-specific request attributes specifying locale
29  * and resource bundle for JSTL's formatting and message tags,
30  * using Spring's locale and message source.
31  *
32  * <p>This is a separate class mainly to avoid JSTL dependencies
33  * in TilesView itself.
34  *
35  * @author Juergen Hoeller
36  * @since 20.08.2003
37  * @see org.springframework.web.servlet.support.JstlUtils#exposeLocalizationContext
38  */

39 public class TilesJstlView extends TilesView {
40
41     private MessageSource jstlAwareMessageSource;
42
43
44     protected void initApplicationContext() {
45         super.initApplicationContext();
46         this.jstlAwareMessageSource =
47                 JstlUtils.getJstlAwareMessageSource(getServletContext(), getApplicationContext());
48     }
49
50
51     protected void exposeHelpers(HttpServletRequest JavaDoc request) throws Exception JavaDoc {
52         JstlUtils.exposeLocalizationContext(request, this.jstlAwareMessageSource);
53     }
54
55 }
56
Popular Tags