/** * Map a view controller to the given URL path (or pattern) in order to render * a response with a pre-configured status code and view. * <p>Patterns like {@code "/admin/**"} or {@code "/articles/{articlename:\\w+}"} * are allowed. See {@link org.springframework.util.AntPathMatcher} for more details on the * syntax. */ public ViewControllerRegistration addViewController(String urlPath) { ViewControllerRegistration registration = new ViewControllerRegistration(urlPath); registration.setApplicationContext(this.applicationContext); this.registrations.add(registration); return registration; }
/** * Map a view controller to the given URL path (or pattern) in order to render * a response with a pre-configured status code and view. * <p>Patterns like {@code "/admin/**"} or {@code "/articles/{articlename:\\w+}"} * are allowed. See {@link org.springframework.util.AntPathMatcher} for more details on the * syntax. */ public ViewControllerRegistration addViewController(String urlPath) { ViewControllerRegistration registration = new ViewControllerRegistration(urlPath); registration.setApplicationContext(this.applicationContext); this.registrations.add(registration); return registration; }
/** * Map a simple controller to the given URL path (or pattern) in order to * set the response status to the given code without rendering a body. * @since 4.1 */ public void addStatusController(String urlPath, HttpStatus statusCode) { ViewControllerRegistration registration = new ViewControllerRegistration(urlPath); registration.setApplicationContext(this.applicationContext); registration.setStatusCode(statusCode); registration.getViewController().setStatusOnly(true); this.registrations.add(registration); }
/** * Map a simple controller to the given URL path (or pattern) in order to * set the response status to the given code without rendering a body. * @since 4.1 */ public void addStatusController(String urlPath, HttpStatus statusCode) { ViewControllerRegistration registration = new ViewControllerRegistration(urlPath); registration.setApplicationContext(this.applicationContext); registration.setStatusCode(statusCode); registration.getViewController().setStatusOnly(true); this.registrations.add(registration); }
/** * Map a view controller to the given URL path (or pattern) in order to render * a response with a pre-configured status code and view. * <p>Patterns like {@code "/admin/**"} or {@code "/articles/{articlename:\\w+}"} * are allowed. See {@link org.springframework.util.AntPathMatcher} for more details on the * syntax. */ public ViewControllerRegistration addViewController(String urlPath) { ViewControllerRegistration registration = new ViewControllerRegistration(urlPath); registration.setApplicationContext(this.applicationContext); this.registrations.add(registration); return registration; }
/** * Map a simple controller to the given URL path (or pattern) in order to * set the response status to the given code without rendering a body. * @since 4.1 */ public void addStatusController(String urlPath, HttpStatus statusCode) { ViewControllerRegistration registration = new ViewControllerRegistration(urlPath); registration.setApplicationContext(this.applicationContext); registration.setStatusCode(statusCode); registration.getViewController().setStatusOnly(true); this.registrations.add(registration); }