Skip to content

Commit

Permalink
Use code includes and tabs in MVC Config documentation
Browse files Browse the repository at this point in the history
Additional fixes.

See spring-projectsgh-22171
  • Loading branch information
sdeleuze committed Mar 29, 2024
1 parent 91bb7d8 commit 186e70c
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions framework-docs/framework-docs.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ dependencies {
api("com.mchange:c3p0:0.9.5.5")
api("com.fasterxml.jackson.core:jackson-databind")
api("com.fasterxml.jackson.module:jackson-module-parameter-names")
api("jakarta.validation:jakarta.validation-api")

implementation(project(":spring-core-test"))
implementation("org.assertj:assertj-core")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class MyPostProcessor implements BeanPostProcessor {

public Object postProcessBeforeInitialization(Object bean, String name) throws BeansException {
// ...
return bean;
}
}
// end::snippet[]
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ public void configurePathMatch(PathMatchConfigurer configurer) {
}

private PathPatternParser patternParser() {
PathPatternParser pathPatternParser = new PathPatternParser();
// ...
return pathPatternParser;
}
}
// end::snippet[]
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

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[]
Expand All @@ -26,7 +27,9 @@ public class WebConfiguration implements WebMvcConfigurer {

@Override
public Validator getValidator() {
Validator validator = new OptionalValidatorFactoryBean();
// ...
return validator;
}
}
// end::snippet[]
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class MyPostProcessor : BeanPostProcessor {

override fun postProcessBeforeInitialization(bean: Any, name: String): Any {
// ...
return bean
}
}
// end::snippet[]
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ class WebConfiguration : WebMvcConfigurer {
}

fun patternParser(): PathPatternParser {
val pathPatternParser = PathPatternParser()
//...
return pathPatternParser
}
}
// end::snippet[]
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@ 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[]
@Configuration
class WebConfiguration : WebMvcConfigurer {

override fun getValidator(): Validator {
val validator = OptionalValidatorFactoryBean()
// ...
return validator
}
}
// end::snippet[]

0 comments on commit 186e70c

Please sign in to comment.