parent
8ce5e88c66
commit
a2a9c47e59
|
|
@ -69,7 +69,9 @@ import org.springframework.util.StringUtils;
|
|||
* @see VelocityEngineFactoryBean
|
||||
* @see org.springframework.web.servlet.view.velocity.VelocityConfigurer
|
||||
* @see org.apache.velocity.app.VelocityEngine
|
||||
* @deprecated as of Spring 4.3, in favor of FreeMarker
|
||||
*/
|
||||
@Deprecated
|
||||
public class VelocityEngineFactory {
|
||||
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
|
|
|||
|
|
@ -46,7 +46,9 @@ import org.springframework.context.ResourceLoaderAware;
|
|||
* @see #setVelocityProperties
|
||||
* @see #setResourceLoaderPath
|
||||
* @see org.springframework.web.servlet.view.velocity.VelocityConfigurer
|
||||
* @deprecated as of Spring 4.3, in favor of FreeMarker
|
||||
*/
|
||||
@Deprecated
|
||||
public class VelocityEngineFactoryBean extends VelocityEngineFactory
|
||||
implements FactoryBean<VelocityEngine>, InitializingBean, ResourceLoaderAware {
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,9 @@ import org.apache.velocity.exception.VelocityException;
|
|||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 22.01.2004
|
||||
* @deprecated as of Spring 4.3, in favor of FreeMarker
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract class VelocityEngineUtils {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ import org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver;
|
|||
import org.springframework.web.servlet.view.groovy.GroovyMarkupViewResolver;
|
||||
import org.springframework.web.servlet.view.script.ScriptTemplateViewResolver;
|
||||
import org.springframework.web.servlet.view.tiles3.TilesViewResolver;
|
||||
import org.springframework.web.servlet.view.velocity.VelocityViewResolver;
|
||||
|
||||
/**
|
||||
* Parse the {@code view-resolvers} MVC namespace element and register
|
||||
|
|
@ -69,6 +68,7 @@ public class ViewResolversBeanDefinitionParser implements BeanDefinitionParser {
|
|||
public static final String VIEW_RESOLVER_BEAN_NAME = "mvcViewResolver";
|
||||
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public BeanDefinition parse(Element element, ParserContext context) {
|
||||
Object source = context.extractSource(element);
|
||||
context.pushContainingComponent(new CompositeComponentDefinition(element.getTagName(), source));
|
||||
|
|
@ -100,7 +100,7 @@ public class ViewResolversBeanDefinitionParser implements BeanDefinitionParser {
|
|||
addUrlBasedViewResolverProperties(resolverElement, resolverBeanDef);
|
||||
}
|
||||
else if ("velocity".equals(name)) {
|
||||
resolverBeanDef = new RootBeanDefinition(VelocityViewResolver.class);
|
||||
resolverBeanDef = new RootBeanDefinition(org.springframework.web.servlet.view.velocity.VelocityViewResolver.class);
|
||||
resolverBeanDef.getPropertyValues().add("suffix", ".vm");
|
||||
addUrlBasedViewResolverProperties(resolverElement, resolverBeanDef);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,8 +41,6 @@ import org.springframework.web.servlet.view.script.ScriptTemplateConfigurer;
|
|||
import org.springframework.web.servlet.view.script.ScriptTemplateViewResolver;
|
||||
import org.springframework.web.servlet.view.tiles3.TilesConfigurer;
|
||||
import org.springframework.web.servlet.view.tiles3.TilesViewResolver;
|
||||
import org.springframework.web.servlet.view.velocity.VelocityConfigurer;
|
||||
import org.springframework.web.servlet.view.velocity.VelocityViewResolver;
|
||||
|
||||
/**
|
||||
* Assist with the configuration of a chain of
|
||||
|
|
@ -86,10 +84,8 @@ public class ViewResolverRegistry {
|
|||
* Enable use of a {@link ContentNegotiatingViewResolver} to front all other
|
||||
* configured view resolvers and select among all selected Views based on
|
||||
* media types requested by the client (e.g. in the Accept header).
|
||||
*
|
||||
* <p>If invoked multiple times the provided default views will be added to
|
||||
* any other default views that may have been configured already.
|
||||
*
|
||||
* @see ContentNegotiatingViewResolver#setDefaultViews
|
||||
*/
|
||||
public void enableContentNegotiation(View... defaultViews) {
|
||||
|
|
@ -100,7 +96,6 @@ public class ViewResolverRegistry {
|
|||
* Enable use of a {@link ContentNegotiatingViewResolver} to front all other
|
||||
* configured view resolvers and select among all selected Views based on
|
||||
* media types requested by the client (e.g. in the Accept header).
|
||||
*
|
||||
* <p>If invoked multiple times the provided default views will be added to
|
||||
* any other default views that may have been configured already.
|
||||
*
|
||||
|
|
@ -112,9 +107,8 @@ public class ViewResolverRegistry {
|
|||
}
|
||||
|
||||
private void initContentNegotiatingViewResolver(View[] defaultViews) {
|
||||
|
||||
// ContentNegotiatingResolver in the registry: elevate its precedence!
|
||||
this.order = (this.order == null ? Ordered.HIGHEST_PRECEDENCE : this.order);
|
||||
this.order = (this.order != null ? this.order : Ordered.HIGHEST_PRECEDENCE);
|
||||
|
||||
if (this.contentNegotiatingResolver != null) {
|
||||
if (!ObjectUtils.isEmpty(defaultViews)) {
|
||||
|
|
@ -136,7 +130,6 @@ public class ViewResolverRegistry {
|
|||
/**
|
||||
* Register JSP view resolver using a default view name prefix of "/WEB-INF/"
|
||||
* and a default suffix of ".jsp".
|
||||
*
|
||||
* <p>When this method is invoked more than once, each call will register a
|
||||
* new ViewResolver instance. Note that since it's not easy to determine
|
||||
* if a JSP exists without forwarding to it, using multiple JSP-based view
|
||||
|
|
@ -149,7 +142,6 @@ public class ViewResolverRegistry {
|
|||
|
||||
/**
|
||||
* Register JSP view resolver with the specified prefix and suffix.
|
||||
*
|
||||
* <p>When this method is invoked more than once, each call will register a
|
||||
* new ViewResolver instance. Note that since it's not easy to determine
|
||||
* if a JSP exists without forwarding to it, using multiple JSP-based view
|
||||
|
|
@ -166,7 +158,6 @@ public class ViewResolverRegistry {
|
|||
|
||||
/**
|
||||
* Register Tiles 3.x view resolver.
|
||||
*
|
||||
* <p><strong>Note</strong> that you must also configure Tiles by adding a
|
||||
* {@link org.springframework.web.servlet.view.tiles3.TilesConfigurer} bean.
|
||||
*/
|
||||
|
|
@ -184,7 +175,6 @@ public class ViewResolverRegistry {
|
|||
/**
|
||||
* Register a FreeMarker view resolver with an empty default view name
|
||||
* prefix and a default suffix of ".ftl".
|
||||
*
|
||||
* <p><strong>Note</strong> that you must also configure FreeMarker by adding a
|
||||
* {@link org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer} bean.
|
||||
*/
|
||||
|
|
@ -203,12 +193,13 @@ public class ViewResolverRegistry {
|
|||
/**
|
||||
* Register Velocity view resolver with an empty default view name
|
||||
* prefix and a default suffix of ".vm".
|
||||
*
|
||||
* <p><strong>Note</strong> that you must also configure Velocity by adding a
|
||||
* {@link org.springframework.web.servlet.view.velocity.VelocityConfigurer} bean.
|
||||
* @deprecated as of Spring 4.3, in favor of FreeMarker
|
||||
*/
|
||||
@Deprecated
|
||||
public UrlBasedViewResolverRegistration velocity() {
|
||||
if (this.applicationContext != null && !hasBeanOfType(VelocityConfigurer.class)) {
|
||||
if (this.applicationContext != null && !hasBeanOfType(org.springframework.web.servlet.view.velocity.VelocityConfigurer.class)) {
|
||||
throw new BeanInitializationException("In addition to a Velocity view resolver " +
|
||||
"there must also be a single VelocityConfig bean in this web application context " +
|
||||
"(or its parent): VelocityConfigurer is the usual implementation. " +
|
||||
|
|
@ -313,22 +304,23 @@ public class ViewResolverRegistry {
|
|||
|
||||
private static class TilesRegistration extends UrlBasedViewResolverRegistration {
|
||||
|
||||
private TilesRegistration() {
|
||||
public TilesRegistration() {
|
||||
super(new TilesViewResolver());
|
||||
}
|
||||
}
|
||||
|
||||
private static class VelocityRegistration extends UrlBasedViewResolverRegistration {
|
||||
|
||||
private VelocityRegistration() {
|
||||
super(new VelocityViewResolver());
|
||||
@SuppressWarnings("deprecation")
|
||||
public VelocityRegistration() {
|
||||
super(new org.springframework.web.servlet.view.velocity.VelocityViewResolver());
|
||||
getViewResolver().setSuffix(".vm");
|
||||
}
|
||||
}
|
||||
|
||||
private static class FreeMarkerRegistration extends UrlBasedViewResolverRegistration {
|
||||
|
||||
private FreeMarkerRegistration() {
|
||||
public FreeMarkerRegistration() {
|
||||
super(new FreeMarkerViewResolver());
|
||||
getViewResolver().setSuffix(".ftl");
|
||||
}
|
||||
|
|
@ -336,7 +328,7 @@ public class ViewResolverRegistry {
|
|||
|
||||
private static class GroovyMarkupRegistration extends UrlBasedViewResolverRegistration {
|
||||
|
||||
private GroovyMarkupRegistration() {
|
||||
public GroovyMarkupRegistration() {
|
||||
super(new GroovyMarkupViewResolver());
|
||||
getViewResolver().setSuffix(".tpl");
|
||||
}
|
||||
|
|
@ -344,7 +336,7 @@ public class ViewResolverRegistry {
|
|||
|
||||
private static class ScriptRegistration extends UrlBasedViewResolverRegistration {
|
||||
|
||||
private ScriptRegistration() {
|
||||
public ScriptRegistration() {
|
||||
super(new ScriptTemplateViewResolver());
|
||||
getViewResolver();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,9 @@ import org.apache.velocity.app.VelocityEngine;
|
|||
* @author Rod Johnson
|
||||
* @see VelocityConfigurer
|
||||
* @see VelocityView
|
||||
* @deprecated as of Spring 4.3, in favor of FreeMarker
|
||||
*/
|
||||
@Deprecated
|
||||
public interface VelocityConfig {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;
|
|||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.context.ResourceLoaderAware;
|
||||
import org.springframework.ui.velocity.VelocityEngineFactory;
|
||||
import org.springframework.web.context.ServletContextAware;
|
||||
|
||||
/**
|
||||
|
|
@ -69,8 +68,10 @@ import org.springframework.web.context.ServletContextAware;
|
|||
* @see #setResourceLoaderPath
|
||||
* @see #setVelocityEngine
|
||||
* @see VelocityView
|
||||
* @deprecated as of Spring 4.3, in favor of FreeMarker
|
||||
*/
|
||||
public class VelocityConfigurer extends VelocityEngineFactory
|
||||
@Deprecated
|
||||
public class VelocityConfigurer extends org.springframework.ui.velocity.VelocityEngineFactory
|
||||
implements VelocityConfig, InitializingBean, ResourceLoaderAware, ServletContextAware {
|
||||
|
||||
/** the name of the resource loader for Spring's bind macros */
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@ import org.springframework.core.NestedIOException;
|
|||
* @see #setLayoutUrl
|
||||
* @see #setLayoutKey
|
||||
* @see #setScreenContentKey
|
||||
* @deprecated as of Spring 4.3, in favor of FreeMarker
|
||||
*/
|
||||
@Deprecated
|
||||
public class VelocityLayoutView extends VelocityToolboxView {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -31,7 +31,9 @@ import org.springframework.web.servlet.view.AbstractUrlBasedView;
|
|||
* @see #setLayoutUrl
|
||||
* @see #setLayoutKey
|
||||
* @see #setScreenContentKey
|
||||
* @deprecated as of Spring 4.3, in favor of FreeMarker
|
||||
*/
|
||||
@Deprecated
|
||||
public class VelocityLayoutViewResolver extends VelocityViewResolver {
|
||||
|
||||
private String layoutUrl;
|
||||
|
|
|
|||
|
|
@ -62,7 +62,9 @@ import org.springframework.util.ReflectionUtils;
|
|||
* @see #initTool
|
||||
* @see org.apache.velocity.tools.view.context.ViewContext
|
||||
* @see org.apache.velocity.tools.view.context.ChainedContext
|
||||
* @deprecated as of Spring 4.3, in favor of FreeMarker
|
||||
*/
|
||||
@Deprecated
|
||||
public class VelocityToolboxView extends VelocityView {
|
||||
|
||||
private String toolboxConfigLocation;
|
||||
|
|
|
|||
|
|
@ -83,7 +83,9 @@ import org.springframework.web.util.NestedServletException;
|
|||
* @see #setVelocityEngine
|
||||
* @see VelocityConfig
|
||||
* @see VelocityConfigurer
|
||||
* @deprecated as of Spring 4.3, in favor of FreeMarker
|
||||
*/
|
||||
@Deprecated
|
||||
public class VelocityView extends AbstractTemplateView {
|
||||
|
||||
private Map<String, Class<?>> toolAttributes;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,9 @@ import org.springframework.web.servlet.view.AbstractUrlBasedView;
|
|||
* @see #setDateToolAttribute
|
||||
* @see #setNumberToolAttribute
|
||||
* @see VelocityView
|
||||
* @deprecated as of Spring 4.3, in favor of FreeMarker
|
||||
*/
|
||||
@Deprecated
|
||||
public class VelocityViewResolver extends AbstractTemplateViewResolver {
|
||||
|
||||
private String dateToolAttribute;
|
||||
|
|
|
|||
|
|
@ -1022,16 +1022,6 @@
|
|||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="velocity" type="urlViewResolverType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
Register a VelocityViewResolver.
|
||||
By default, ".vm" is configured as a view name suffix.
|
||||
To configure Velocity you must also add a top-level <mvc:velocity-configurer> element
|
||||
or declare a VelocityConfigurer bean.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="groovy" type="urlViewResolverType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
|
|
@ -1170,24 +1160,6 @@
|
|||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="velocity-configurer">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
Configure Velocity for view resolution by registering a VelocityConfigurer bean.
|
||||
This is a shortcut alternative to declaring a VelocityConfigurer bean directly.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="resource-loader-path" type="xsd:string" use="required">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
The Velocity resource loader path via a Spring resource location.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="groovy-configurer">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
|
|
|
|||
Loading…
Reference in New Issue