001/*
002 * Copyright 2002-2009 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      https://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.web.servlet.view.tiles2;
018
019import org.apache.tiles.TilesException;
020import org.apache.tiles.preparer.ViewPreparer;
021
022import org.springframework.web.context.WebApplicationContext;
023
024/**
025 * Tiles {@link org.apache.tiles.preparer.PreparerFactory} implementation
026 * that expects preparer bean names and obtains preparer beans from the
027 * Spring ApplicationContext. The full bean creation process will be in
028 * the control of the Spring application context in this case, allowing
029 * for the use of scoped beans etc.
030 *
031 * <p><b>NOTE: Tiles 2 support is deprecated in favor of Tiles 3 and will be removed
032 * as of Spring Framework 5.0.</b>.
033 *
034 * @author Juergen Hoeller
035 * @since 2.5
036 * @see SimpleSpringPreparerFactory
037 * @deprecated as of Spring 4.2, in favor of Tiles 3
038 */
039@Deprecated
040public class SpringBeanPreparerFactory extends AbstractSpringPreparerFactory {
041
042        @Override
043        protected ViewPreparer getPreparer(String name, WebApplicationContext context) throws TilesException {
044                return context.getBean(name, ViewPreparer.class);
045        }
046
047}