| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -69,7 +69,9 @@ | |||
| 69 | 69 | * @see VelocityEngineFactoryBean | |
| 70 | 70 | * @see org.springframework.web.servlet.view.velocity.VelocityConfigurer | |
| 71 | 71 | * @see org.apache.velocity.app.VelocityEngine | |
| 72 | + * @deprecated as of Spring 4.3, in favor of FreeMarker | ||
| 72 | 73 | */ | |
| 74 | + @Deprecated | ||
| 73 | 75 | public class VelocityEngineFactory { | |
| 74 | 76 | ||
| 75 | 77 | protected final Log logger = LogFactory.getLog(getClass()); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -46,7 +46,9 @@ | |||
| 46 | 46 | * @see #setVelocityProperties | |
| 47 | 47 | * @see #setResourceLoaderPath | |
| 48 | 48 | * @see org.springframework.web.servlet.view.velocity.VelocityConfigurer | |
| 49 | + * @deprecated as of Spring 4.3, in favor of FreeMarker | ||
| 49 | 50 | */ | |
| 51 | + @Deprecated | ||
| 50 | 52 | public class VelocityEngineFactoryBean extends VelocityEngineFactory | |
| 51 | 53 | implements FactoryBean<VelocityEngine>, InitializingBean, ResourceLoaderAware { | |
| 52 | 54 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,7 +30,9 @@ | |||
| 30 | 30 | * | |
| 31 | 31 | * @author Juergen Hoeller | |
| 32 | 32 | * @since 22.01.2004 | |
| 33 | + * @deprecated as of Spring 4.3, in favor of FreeMarker | ||
| 33 | 34 | */ | |
| 35 | + @Deprecated | ||
| 34 | 36 | public abstract class VelocityEngineUtils { | |
| 35 | 37 | ||
| 36 | 38 | /** | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -39,7 +39,6 @@ | |||
| 39 | 39 | import org.springframework.web.servlet.view.groovy.GroovyMarkupViewResolver; | |
| 40 | 40 | import org.springframework.web.servlet.view.script.ScriptTemplateViewResolver; | |
| 41 | 41 | import org.springframework.web.servlet.view.tiles3.TilesViewResolver; | |
| 42 | - import org.springframework.web.servlet.view.velocity.VelocityViewResolver; | ||
| 43 | 42 | ||
| 44 | 43 | /** | |
| 45 | 44 | * Parse the {@code view-resolvers} MVC namespace element and register | |
@@ -69,6 +68,7 @@ public class ViewResolversBeanDefinitionParser implements BeanDefinitionParser { | |||
| 69 | 68 | public static final String VIEW_RESOLVER_BEAN_NAME = "mvcViewResolver"; | |
| 70 | 69 | ||
| 71 | 70 | ||
| 71 | + @SuppressWarnings("deprecation") | ||
| 72 | 72 | public BeanDefinition parse(Element element, ParserContext context) { | |
| 73 | 73 | Object source = context.extractSource(element); | |
| 74 | 74 | context.pushContainingComponent(new CompositeComponentDefinition(element.getTagName(), source)); | |
@@ -100,7 +100,7 @@ else if ("freemarker".equals(name)) { | |||
| 100 | 100 | addUrlBasedViewResolverProperties(resolverElement, resolverBeanDef); | |
| 101 | 101 | } | |
| 102 | 102 | else if ("velocity".equals(name)) { | |
| 103 | - resolverBeanDef = new RootBeanDefinition(VelocityViewResolver.class); | ||
| 103 | + resolverBeanDef = new RootBeanDefinition(org.springframework.web.servlet.view.velocity.VelocityViewResolver.class); | ||
| 104 | 104 | resolverBeanDef.getPropertyValues().add("suffix", ".vm"); | |
| 105 | 105 | addUrlBasedViewResolverProperties(resolverElement, resolverBeanDef); | |
| 106 | 106 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,8 +41,6 @@ | |||
| 41 | 41 | import org.springframework.web.servlet.view.script.ScriptTemplateViewResolver; | |
| 42 | 42 | import org.springframework.web.servlet.view.tiles3.TilesConfigurer; | |
| 43 | 43 | import org.springframework.web.servlet.view.tiles3.TilesViewResolver; | |
| 44 | - import org.springframework.web.servlet.view.velocity.VelocityConfigurer; | ||
| 45 | - import org.springframework.web.servlet.view.velocity.VelocityViewResolver; | ||
| 46 | 44 | ||
| 47 | 45 | /** | |
| 48 | 46 | * Assist with the configuration of a chain of | |
@@ -86,10 +84,8 @@ public boolean hasRegistrations() { | |||
| 86 | 84 | * Enable use of a {@link ContentNegotiatingViewResolver} to front all other | |
| 87 | 85 | * configured view resolvers and select among all selected Views based on | |
| 88 | 86 | * media types requested by the client (e.g. in the Accept header). | |
| 89 | - * | ||
| 90 | 87 | * <p>If invoked multiple times the provided default views will be added to | |
| 91 | 88 | * any other default views that may have been configured already. | |
| 92 | - * | ||
| 93 | 89 | * @see ContentNegotiatingViewResolver#setDefaultViews | |
| 94 | 90 | */ | |
| 95 | 91 | public void enableContentNegotiation(View... defaultViews) { | |
@@ -100,7 +96,6 @@ public void enableContentNegotiation(View... defaultViews) { | |||
| 100 | 96 | * Enable use of a {@link ContentNegotiatingViewResolver} to front all other | |
| 101 | 97 | * configured view resolvers and select among all selected Views based on | |
| 102 | 98 | * media types requested by the client (e.g. in the Accept header). | |
| 103 | - * | ||
| 104 | 99 | * <p>If invoked multiple times the provided default views will be added to | |
| 105 | 100 | * any other default views that may have been configured already. | |
| 106 | 101 | * | |
@@ -112,9 +107,8 @@ public void enableContentNegotiation(boolean useNotAcceptableStatus, View... def | |||
| 112 | 107 | } | |
| 113 | 108 | ||
| 114 | 109 | private void initContentNegotiatingViewResolver(View[] defaultViews) { | |
| 115 | - | ||
| 116 | 110 | // ContentNegotiatingResolver in the registry: elevate its precedence! | |
| 117 | - this.order = (this.order == null ? Ordered.HIGHEST_PRECEDENCE : this.order); | ||
| 111 | + this.order = (this.order != null ? this.order : Ordered.HIGHEST_PRECEDENCE); | ||
| 118 | 112 | ||
| 119 | 113 | if (this.contentNegotiatingResolver != null) { | |
| 120 | 114 | if (!ObjectUtils.isEmpty(defaultViews)) { | |
@@ -136,7 +130,6 @@ private void initContentNegotiatingViewResolver(View[] defaultViews) { | |||
| 136 | 130 | /** | |
| 137 | 131 | * Register JSP view resolver using a default view name prefix of "/WEB-INF/" | |
| 138 | 132 | * and a default suffix of ".jsp". | |
| 139 | - * | ||
| 140 | 133 | * <p>When this method is invoked more than once, each call will register a | |
| 141 | 134 | * new ViewResolver instance. Note that since it's not easy to determine | |
| 142 | 135 | * if a JSP exists without forwarding to it, using multiple JSP-based view | |
@@ -149,7 +142,6 @@ public UrlBasedViewResolverRegistration jsp() { | |||
| 149 | 142 | ||
| 150 | 143 | /** | |
| 151 | 144 | * Register JSP view resolver with the specified prefix and suffix. | |
| 152 | - * | ||
| 153 | 145 | * <p>When this method is invoked more than once, each call will register a | |
| 154 | 146 | * new ViewResolver instance. Note that since it's not easy to determine | |
| 155 | 147 | * if a JSP exists without forwarding to it, using multiple JSP-based view | |
@@ -166,7 +158,6 @@ public UrlBasedViewResolverRegistration jsp(String prefix, String suffix) { | |||
| 166 | 158 | ||
| 167 | 159 | /** | |
| 168 | 160 | * Register Tiles 3.x view resolver. | |
| 169 | - * | ||
| 170 | 161 | * <p><strong>Note</strong> that you must also configure Tiles by adding a | |
| 171 | 162 | * {@link org.springframework.web.servlet.view.tiles3.TilesConfigurer} bean. | |
| 172 | 163 | */ | |
@@ -184,7 +175,6 @@ public UrlBasedViewResolverRegistration tiles() { | |||
| 184 | 175 | /** | |
| 185 | 176 | * Register a FreeMarker view resolver with an empty default view name | |
| 186 | 177 | * prefix and a default suffix of ".ftl". | |
| 187 | - * | ||
| 188 | 178 | * <p><strong>Note</strong> that you must also configure FreeMarker by adding a | |
| 189 | 179 | * {@link org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer} bean. | |
| 190 | 180 | */ | |
@@ -203,12 +193,13 @@ public UrlBasedViewResolverRegistration freeMarker() { | |||
| 203 | 193 | /** | |
| 204 | 194 | * Register Velocity view resolver with an empty default view name | |
| 205 | 195 | * prefix and a default suffix of ".vm". | |
| 206 | - * | ||
| 207 | 196 | * <p><strong>Note</strong> that you must also configure Velocity by adding a | |
| 208 | 197 | * {@link org.springframework.web.servlet.view.velocity.VelocityConfigurer} bean. | |
| 198 | + * @deprecated as of Spring 4.3, in favor of FreeMarker | ||
| 209 | 199 | */ | |
| 200 | + @Deprecated | ||
| 210 | 201 | public UrlBasedViewResolverRegistration velocity() { | |
| 211 | - if (this.applicationContext != null && !hasBeanOfType(VelocityConfigurer.class)) { | ||
| 202 | + if (this.applicationContext != null && !hasBeanOfType(org.springframework.web.servlet.view.velocity.VelocityConfigurer.class)) { | ||
| 212 | 203 | throw new BeanInitializationException("In addition to a Velocity view resolver " + | |
| 213 | 204 | "there must also be a single VelocityConfig bean in this web application context " + | |
| 214 | 205 | "(or its parent): VelocityConfigurer is the usual implementation. " + | |
@@ -313,38 +304,39 @@ protected List<ViewResolver> getViewResolvers() { | |||
| 313 | 304 | ||
| 314 | 305 | private static class TilesRegistration extends UrlBasedViewResolverRegistration { | |
| 315 | 306 | ||
| 316 | - private TilesRegistration() { | ||
| 307 | + public TilesRegistration() { | ||
| 317 | 308 | super(new TilesViewResolver()); | |
| 318 | 309 | } | |
| 319 | 310 | } | |
| 320 | 311 | ||
| 321 | 312 | private static class VelocityRegistration extends UrlBasedViewResolverRegistration { | |
| 322 | 313 | ||
| 323 | - private VelocityRegistration() { | ||
| 324 | - super(new VelocityViewResolver()); | ||
| 314 | + @SuppressWarnings("deprecation") | ||
| 315 | + public VelocityRegistration() { | ||
| 316 | + super(new org.springframework.web.servlet.view.velocity.VelocityViewResolver()); | ||
| 325 | 317 | getViewResolver().setSuffix(".vm"); | |
| 326 | 318 | } | |
| 327 | 319 | } | |
| 328 | 320 | ||
| 329 | 321 | private static class FreeMarkerRegistration extends UrlBasedViewResolverRegistration { | |
| 330 | 322 | ||
| 331 | - private FreeMarkerRegistration() { | ||
| 323 | + public FreeMarkerRegistration() { | ||
| 332 | 324 | super(new FreeMarkerViewResolver()); | |
| 333 | 325 | getViewResolver().setSuffix(".ftl"); | |
| 334 | 326 | } | |
| 335 | 327 | } | |
| 336 | 328 | ||
| 337 | 329 | private static class GroovyMarkupRegistration extends UrlBasedViewResolverRegistration { | |
| 338 | 330 | ||
| 339 | - private GroovyMarkupRegistration() { | ||
| 331 | + public GroovyMarkupRegistration() { | ||
| 340 | 332 | super(new GroovyMarkupViewResolver()); | |
| 341 | 333 | getViewResolver().setSuffix(".tpl"); | |
| 342 | 334 | } | |
| 343 | 335 | } | |
| 344 | 336 | ||
| 345 | 337 | private static class ScriptRegistration extends UrlBasedViewResolverRegistration { | |
| 346 | 338 | ||
| 347 | - private ScriptRegistration() { | ||
| 339 | + public ScriptRegistration() { | ||
| 348 | 340 | super(new ScriptTemplateViewResolver()); | |
| 349 | 341 | getViewResolver(); | |
| 350 | 342 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,7 +26,9 @@ | |||
| 26 | 26 | * @author Rod Johnson | |
| 27 | 27 | * @see VelocityConfigurer | |
| 28 | 28 | * @see VelocityView | |
| 29 | + * @deprecated as of Spring 4.3, in favor of FreeMarker | ||
| 29 | 30 | */ | |
| 31 | + @Deprecated | ||
| 30 | 32 | public interface VelocityConfig { | |
| 31 | 33 | ||
| 32 | 34 | /** | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,7 +25,6 @@ | |||
| 25 | 25 | ||
| 26 | 26 | import org.springframework.beans.factory.InitializingBean; | |
| 27 | 27 | import org.springframework.context.ResourceLoaderAware; | |
| 28 | - import org.springframework.ui.velocity.VelocityEngineFactory; | ||
| 29 | 28 | import org.springframework.web.context.ServletContextAware; | |
| 30 | 29 | ||
| 31 | 30 | /** | |
@@ -69,8 +68,10 @@ | |||
| 69 | 68 | * @see #setResourceLoaderPath | |
| 70 | 69 | * @see #setVelocityEngine | |
| 71 | 70 | * @see VelocityView | |
| 71 | + * @deprecated as of Spring 4.3, in favor of FreeMarker | ||
| 72 | 72 | */ | |
| 73 | - public class VelocityConfigurer extends VelocityEngineFactory | ||
| 73 | + @Deprecated | ||
| 74 | + public class VelocityConfigurer extends org.springframework.ui.velocity.VelocityEngineFactory | ||
| 74 | 75 | implements VelocityConfig, InitializingBean, ResourceLoaderAware, ServletContextAware { | |
| 75 | 76 | ||
| 76 | 77 | /** the name of the resource loader for Spring's bind macros */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -50,7 +50,9 @@ | |||
| 50 | 50 | * @see #setLayoutUrl | |
| 51 | 51 | * @see #setLayoutKey | |
| 52 | 52 | * @see #setScreenContentKey | |
| 53 | + * @deprecated as of Spring 4.3, in favor of FreeMarker | ||
| 53 | 54 | */ | |
| 55 | + @Deprecated | ||
| 54 | 56 | public class VelocityLayoutView extends VelocityToolboxView { | |
| 55 | 57 | ||
| 56 | 58 | /** | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,7 +31,9 @@ | |||
| 31 | 31 | * @see #setLayoutUrl | |
| 32 | 32 | * @see #setLayoutKey | |
| 33 | 33 | * @see #setScreenContentKey | |
| 34 | + * @deprecated as of Spring 4.3, in favor of FreeMarker | ||
| 34 | 35 | */ | |
| 36 | + @Deprecated | ||
| 35 | 37 | public class VelocityLayoutViewResolver extends VelocityViewResolver { | |
| 36 | 38 | ||
| 37 | 39 | private String layoutUrl; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -62,7 +62,9 @@ | |||
| 62 | 62 | * @see #initTool | |
| 63 | 63 | * @see org.apache.velocity.tools.view.context.ViewContext | |
| 64 | 64 | * @see org.apache.velocity.tools.view.context.ChainedContext | |
| 65 | + * @deprecated as of Spring 4.3, in favor of FreeMarker | ||
| 65 | 66 | */ | |
| 67 | + @Deprecated | ||
| 66 | 68 | public class VelocityToolboxView extends VelocityView { | |
| 67 | 69 | ||
| 68 | 70 | private String toolboxConfigLocation; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments