Use code includes and tabs in MVC Config documentation
Additional fixes. See gh-22171
This commit is contained in:
@@ -26,6 +26,7 @@ public class MyPostProcessor implements BeanPostProcessor {
|
||||
|
||||
public Object postProcessBeforeInitialization(Object bean, String name) throws BeansException {
|
||||
// ...
|
||||
return bean;
|
||||
}
|
||||
}
|
||||
// end::snippet[]
|
||||
|
||||
@@ -17,7 +17,9 @@ public class WebConfiguration implements WebMvcConfigurer {
|
||||
}
|
||||
|
||||
private PathPatternParser patternParser() {
|
||||
PathPatternParser pathPatternParser = new PathPatternParser();
|
||||
// ...
|
||||
return pathPatternParser;
|
||||
}
|
||||
}
|
||||
// end::snippet[]
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.springframework.docs.web.webmvc.mvcconfig.mvcconfigvalidation;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.validation.Validator;
|
||||
import org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
// tag::snippet[]
|
||||
@@ -26,7 +27,9 @@ public class WebConfiguration implements WebMvcConfigurer {
|
||||
|
||||
@Override
|
||||
public Validator getValidator() {
|
||||
Validator validator = new OptionalValidatorFactoryBean();
|
||||
// ...
|
||||
return validator;
|
||||
}
|
||||
}
|
||||
// end::snippet[]
|
||||
|
||||
@@ -25,6 +25,7 @@ class MyPostProcessor : BeanPostProcessor {
|
||||
|
||||
override fun postProcessBeforeInitialization(bean: Any, name: String): Any {
|
||||
// ...
|
||||
return bean
|
||||
}
|
||||
}
|
||||
// end::snippet[]
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@file:Suppress("DEPRECATION")
|
||||
package org.springframework.docs.web.webmvc.mvcconfig.mvcconfiginterceptors
|
||||
|
||||
import org.springframework.context.annotation.Configuration
|
||||
|
||||
@@ -32,7 +32,9 @@ class WebConfiguration : WebMvcConfigurer {
|
||||
}
|
||||
|
||||
fun patternParser(): PathPatternParser {
|
||||
val pathPatternParser = PathPatternParser()
|
||||
//...
|
||||
return pathPatternParser
|
||||
}
|
||||
}
|
||||
// end::snippet[]
|
||||
@@ -18,6 +18,7 @@ package org.springframework.docs.web.webmvc.mvcconfig.mvcconfigvalidation
|
||||
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import org.springframework.validation.Validator
|
||||
import org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
|
||||
|
||||
// tag::snippet[]
|
||||
@@ -25,7 +26,9 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
|
||||
class WebConfiguration : WebMvcConfigurer {
|
||||
|
||||
override fun getValidator(): Validator {
|
||||
val validator = OptionalValidatorFactoryBean()
|
||||
// ...
|
||||
return validator
|
||||
}
|
||||
}
|
||||
// end::snippet[]
|
||||
|
||||
Reference in New Issue
Block a user