|
38 | 38 | import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty;
|
39 | 39 | import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
40 | 40 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
| 41 | +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
41 | 42 | import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
42 | 43 | import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
|
43 | 44 | import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
|
|
139 | 140 | * @author Bruce Brouwer
|
140 | 141 | * @author Artsiom Yudovin
|
141 | 142 | * @author Scott Frederick
|
| 143 | + * @author daewon kim |
142 | 144 | * @since 2.0.0
|
143 | 145 | */
|
144 | 146 | @AutoConfiguration(after = { DispatcherServletAutoConfiguration.class, TaskExecutionAutoConfiguration.class,
|
@@ -282,13 +284,23 @@ public void configureContentNegotiation(ContentNegotiationConfigurer configurer)
|
282 | 284 |
|
283 | 285 | @Bean
|
284 | 286 | @ConditionalOnMissingBean
|
| 287 | + @ConditionalOnProperty(prefix = "spring.mvc.view", name = {"prefix", "suffix"}) |
285 | 288 | public InternalResourceViewResolver defaultViewResolver() {
|
286 | 289 | InternalResourceViewResolver resolver = new InternalResourceViewResolver();
|
287 | 290 | resolver.setPrefix(this.mvcProperties.getView().getPrefix());
|
288 | 291 | resolver.setSuffix(this.mvcProperties.getView().getSuffix());
|
289 | 292 | return resolver;
|
290 | 293 | }
|
291 | 294 |
|
| 295 | + @Bean |
| 296 | + @ConditionalOnProperty(prefix = "spring.mvc.jsp", name = {"prefix", "suffix"}) |
| 297 | + public InternalResourceViewResolver jspViewResolver() { |
| 298 | + InternalResourceViewResolver resolver = new InternalResourceViewResolver(); |
| 299 | + resolver.setPrefix(this.mvcProperties.getJsp().getPrefix()); |
| 300 | + resolver.setSuffix(this.mvcProperties.getJsp().getSuffix()); |
| 301 | + return resolver; |
| 302 | + } |
| 303 | + |
292 | 304 | @Bean
|
293 | 305 | @ConditionalOnBean(View.class)
|
294 | 306 | @ConditionalOnMissingBean
|
|
0 commit comments