官方文档:https://docs.spring.io/spring-boot/docs/2.3.9.RELEASE/reference/htmlsingle/#using-boot-auto-configuration

本片文章大部分是翻译SpringBoot的使用手册中的文章,希望大家能有耐心的看文本片文章。

1、Spring MVC Auto-configuration 自动配置

备注:进入到文档直接搜索 Spring MVC Auto-configuration找到自动配置的文档介绍,打开项目双机shift 输入WebMvcAutoConfiguration查看自动配置类中的内容。

The auto-configuration adds the following features on top of Spring’s defaults:

自动配置在 Spring 默认设置的基础上增加了以下特性:

  • Inclusion of ContentNegotiatingViewResolver and BeanNameViewResolver beans.

    翻译:包含 ContentNegotiatingViewResolver 和 BeanNameViewResolver bean。

    自动配置ViewResolver(试图解析器:根据方法的返回值得到试图对象(View),试图对象决定如何渲染)

  • Support for serving static resources, including support for WebJars (covered later in this document)).

    翻译:支持服务静态资源,包括对 webjar 的支持。

  • Automatic registration of Converter, GenericConverter, and Formatter beans.

    翻译:转换器、 GenericConverter 和 Formatter bean 的自动注册。

    Converter :类型转换器 -接受参数时转成对象

    Formatter:格式化器:2021.10.27转成date

  • Support for HttpMessageConverters (covered later in this document).

    翻译:对 HttpMessageConverters 的支持。

  • Automatic registration of MessageCodesResolver (covered later in this document).

    翻译:MessageCodesResolver 的自动注册。

  • Static index.html support.

    翻译:静态索引支持。

  • Custom Favicon support (covered later in this document).

    翻译:自定义图标支持。

  • Automatic use of a ConfigurableWebBindingInitializer bean (covered later in this document).

    翻译:自动使用 ConfigurableWebBindingInitializer bean 。

If you want to keep those Spring Boot MVC customizations and make more MVC customizations (interceptors, formatters, view controllers, and other features), you can add your own @Configuration class of type WebMvcConfigurer but without @EnableWebMvc.

如果您希望保留 Spring Boot MVC 定制并进行更多的 MVC 定制(拦截器、格式化程序、视图控制器和其他特性) ,可以添加您自己的 webmvcrer 类型的@configuration 类,但不要添加@enablewebmvc。

If you want to provide custom instances of RequestMappingHandlerMapping, RequestMappingHandlerAdapter, or ExceptionHandlerExceptionResolver, and still keep the Spring Boot MVC customizations, you can declare a bean of type WebMvcRegistrations and use it to provide custom instances of those components.

如果你想提供自定义的 requestmappinghandler mapping、 requestmappinghandler adapter 或 exceptionhandlerexceptionmvc 定制,你可以声明一个类型为 WebMvcRegistrations 的 bean,并使用它来提供这些组件的自定义实例。

If you want to take complete control of Spring MVC, you can add your own @Configuration annotated with @EnableWebMvc, or alternatively add your own @Configuration-annotated DelegatingWebMvcConfiguration as described in the Javadoc of @EnableWebMvc.

如果你想完全控制 Spring MVC,你可以添加你自己的@configuration 注释@enablewebmvc,或者像在@enablewebmvc 的 Javadoc 中描述的那样添加你自己的@configuration 注释 delegatingwebmvcvc 配置。

Spring MVC uses a different ConversionService to the one used to convert values from your application.properties or application.yaml file. The means that Period, Duration and DataSize converters are not available and that @DurationUnit and @DataSizeUnit annotations will be ignored.Spring MVC 使用不同的 ConversionService 来转换 application.properties 或 application.yaml 文件中的值。这意味着 Period、 Duration 和 DataSize 转换器不可用,并且@durationunit 和@datasizeunit 注释将被忽略。If you want to customize the ConversionService used by Spring MVC, you can provide a WebMvcConfigurer bean with an addFormatters method. From this method you can register any converter that you like, or you can delegate to the static methods available on ApplicationConversionService.如果希望自定义 Spring MVC 使用的 ConversionService,可以使用 addformatter 方法提供 webmvcconfigurebean。通过这个方法,您可以注册任何您喜欢的转换器,或者您可以委托给 ApplicationConversionService 上可用的静态方法。

HttpMessageConverters Http//messageconverters

Spring MVC uses the HttpMessageConverter interface to convert HTTP requests and responses. Sensible defaults are included out of the box. For example, objects can be automatically converted to JSON (by using the Jackson library) or XML (by using the Jackson XML extension, if available, or by using JAXB if the Jackson XML extension is not available). By default, strings are encoded in UTF-8.

Springmvc 使用 HttpMessageConverter 接口来转换 HTTP 请求和响应。明智的默认设置是开箱即用的。例如,对象可以自动转换为 JSON (通过使用 Jackson 库)或 XML (通过使用 Jackson XML 扩展(如果可用) ,或者通过使用 JAXB (如果 Jackson XML 扩展不可用)。默认情况下,字符串以 UTF-8编码。

If you need to add or customize converters, you can use Spring Boot’s HttpMessageConverters class, as shown in the following listing:

如果你需要添加或者定制转换器,你可以使用 Spring Boot 的 HttpMessageConverters 类,如下面的清单所示:

import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.context.annotation.*;
import org.springframework.http.converter.*;@Configuration(proxyBeanMethods = false)
public class MyConfiguration {@Beanpublic HttpMessageConverters customConverters() {HttpMessageConverter<?> additional = ...HttpMessageConverter<?> another = ...return new HttpMessageConverters(additional, another);}}

Any HttpMessageConverter bean that is present in the context is added to the list of converters. You can also override default converters in the same way.

上下文中出现的任何 HttpMessageConverter bean 都将添加到转换器列表中。您也可以用同样的方法覆盖默认转换器。

Custom JSON Serializers and Deserializers 自定义 JSON 序列化器和反序列化器

If you use Jackson to serialize and deserialize JSON data, you might want to write your own JsonSerializer and JsonDeserializer classes. Custom serializers are usually registered with Jackson through a module, but Spring Boot provides an alternative @JsonComponent annotation that makes it easier to directly register Spring Beans.

如果使用 Jackson 对 JSON 数据进行序列化和反序列化,则可能需要编写自己的 JsonSerializer 和 JsonDeserializer 类。自定义序列化程序通常通过一个模块向 Jackson 注册,但 Spring Boot 提供了一个替代的@jsoncomponent 注释,使得直接注册 Spring Beans 变得更加容易。

You can use the @JsonComponent annotation directly on JsonSerializer, JsonDeserializer or KeyDeserializer implementations. You can also use it on classes that contain serializers/deserializers as inner classes, as shown in the following example:

您可以直接在 JsonSerializer、 JsonDeserializer 或 KeyDeserializer 实现上使用@jsoncomponent 注释。也可以在包含序列化器/反序列化器作为内部类的类上使用它,如下面的示例所示:

import java.io.*;
import com.fasterxml.jackson.core.*;
import com.fasterxml.jackson.databind.*;
import org.springframework.boot.jackson.*;@JsonComponent
public class Example {public static class Serializer extends JsonSerializer<SomeObject> {// ...}public static class Deserializer extends JsonDeserializer<SomeObject> {// ...}}

All @JsonComponent beans in the ApplicationContext are automatically registered with Jackson. Because @JsonComponent is meta-annotated with @Component, the usual component-scanning rules apply.

ApplicationContext 中的所有@jsoncomponent bean 都会自动向 Jackson 注册。因为@jsoncomponent 使用@component 进行了元注释,所以应用了通常的组件扫描规则。

Spring Boot also provides JsonObjectSerializer and JsonObjectDeserializer base classes that provide useful alternatives to the standard Jackson versions when serializing objects. See JsonObjectSerializer and JsonObjectDeserializer in the Javadoc for details.

Spring Boot 还提供了 JsonObjectSerializer 和 JsonObjectDeserializer 基类,它们在序列化对象时为标准 Jackson 版本提供了有用的替代方法。有关详细信息,请参阅 Javadoc 中的 JsonObjectSerializer 和 JsonObjectDeserializer。

1.1MessageCodesResolver

Spring MVC has a strategy for generating error codes for rendering error messages from binding errors: MessageCodesResolver. If you set the spring.mvc.message-codes-resolver-format property PREFIX_ERROR_CODE or POSTFIX_ERROR_CODE, Spring Boot creates one for you (see the enumeration in DefaultMessageCodesResolver.Format).

Springmvc 有一个用于生成错误代码的策略,用于从绑定错误中呈现错误消息: MessageCodesResolver。如果您设置了 Spring.mvc.message-codes-resolver-format 属性 PREFIX _ error _ code 或 POSTFIX _ error _ code,Spring Boot 将为您创建一个属性(参见 DefaultMessageCodesResolver 中的枚举)。格式)。

1.2Static Content 静态内容

By default, Spring Boot serves static content from a directory called /static (or /public or /resources or /META-INF/resources) in the classpath or from the root of the ServletContext. It uses the ResourceHttpRequestHandler from Spring MVC so that you can modify that behavior by adding your own WebMvcConfigurer and overriding the addResourceHandlers method.

默认情况下,Spring Boot 从类路径中的/static (或/public 或/resources 或/META-INF/resources)目录或 ServletContext 的根目录提供静态内容。它使用 Spring MVC 中的 ResourceHttpRequestHandler,因此您可以通过添加自己的 webmvcconfigureer 和重写 resourcehandlers 方法来修改该行为。

In a stand-alone web application, the default servlet from the container is also enabled and acts as a fallback, serving content from the root of the ServletContext if Spring decides not to handle it. Most of the time, this does not happen (unless you modify the default MVC configuration), because Spring can always handle requests through the DispatcherServlet.

By default, resources are mapped on /**, but you can tune that with the spring.mvc.static-path-pattern property. For instance, relocating all resources to /resources/** can be achieved as follows:

默认情况下,资源映射在/* * 上,但是可以使用 spring.mvc.static-path-pattern 属性对其进行优化。例如,将所有资源转移到/resources/* * 可以做到以下几点:

spring.mvc.static-path-pattern=/resources/**

You can also customize the static resource locations by using the spring.resources.static-locations property (replacing the default values with a list of directory locations). The root Servlet context path, "/", is automatically added as a location as well.

还可以使用 spring.resources.static-locations 属性(用目录位置列表替换默认值)自定义静态资源位置。根 Servlet 上下文路径“/”也会自动作为位置添加。

In addition to the “standard” static resource locations mentioned earlier, a special case is made for Webjars content. Any resources with a path in /webjars/** are served from jar files if they are packaged in the Webjars format.

除了前面提到的“标准”静态资源位置之外,还为 Webjars 内容制作了一个特例。任何路径在/webjar/* * 中的资源如果以 Webjars 格式打包,都可以从 jar 文件中获得。

Do not use the 不要使用src/main/webapp directory if your application is packaged as a jar. Although this directory is a common standard, it works 尽管这个目录是一个通用的标准,但是它是可以工作的only 只 with war packaging, and it is silently ignored by most build tools if you generate a jar. 如果你生成一个 jar,大多数构建工具都会默默地忽略它

Spring Boot also supports the advanced resource handling features provided by Spring MVC, allowing use cases such as cache-busting static resources or using version agnostic URLs for Webjars.

Spring Boot 还支持 Spring MVC 提供的高级资源处理特性,允许使用例如缓存破坏静态资源或为 Webjars 使用版本不可知的 url。

To use version agnostic URLs for Webjars, add the webjars-locator-core dependency. Then declare your Webjar. Using jQuery as an example, adding "/webjars/jquery/jquery.min.js" results in "/webjars/jquery/x.y.z/jquery.min.js" where x.y.z is the Webjar version.

若要为 Webjars 使用版本不可知的 url,请添加 Webjars-locator-core 依赖项。然后声明你的 Webjar。以 jQuery 为例,添加”/webjars/jQuery/jQuery.min.js”会导致”/webjars/jQuery/x.y.z/jQuery.min.js”,其中 x.y.z 是 Webjar 版本。

If you use JBoss, you need to declare the webjars-locator-jboss-vfs dependency instead of the 依赖性而不是webjars-locator-core. Otherwise, all Webjars resolve as a 。否则,所有 webjar 将解析为404.

To use cache busting, the following configuration configures a cache busting solution for all static resources, effectively adding a content hash, such as <link href="/css/spring-2a2d595e6ed9a0b24f027f2b63b134d6.css"/>, in URLs:

为了使用缓存破坏,以下配置为所有静态资源配置缓存破坏解决方案,有效地在 url 中添加内容散列,如 < link href = “/css/spring-2a2d595e6ed9a0b24f027f2b63b134d6.css”/> :

spring.resources.chain.strategy.content.enabled=true
spring.resources.chain.strategy.content.paths=/**
Links to resources are rewritten in templates at runtime, thanks to a ResourceUrlEncodingFilter that is auto-configured for Thymeleaf and FreeMarker. You should manually declare this filter when using JSPs. Other template engines are currently not automatically supported but can be with custom template macros/helpers and the use of the 是自动配置的 Thymeleaf 和 FreeMarker。在使用 jsp 时,应该手动声明这个过滤器。其他模板引擎目前不受自动支持,但可以使用自定义模板宏/帮助程序和ResourceUrlProvider.

When loading resources dynamically with, for example, a JavaScript module loader, renaming files is not an option. That is why other strategies are also supported and can be combined. A “fixed” strategy adds a static version string in the URL without changing the file name, as shown in the following example:

当使用例如 JavaScript 模块加载程序动态加载资源时,不能选择重命名文件。这就是为什么其他策略也得到支持,并且可以结合起来。“ fixed”策略在 URL 中添加静态版本字符串,而不更改文件名,如下面的示例所示:

spring.resources.chain.strategy.content.enabled=true
spring.resources.chain.strategy.content.paths=/**
spring.resources.chain.strategy.fixed.enabled=true
spring.resources.chain.strategy.fixed.paths=/js/lib/
spring.resources.chain.strategy.fixed.version=v12

With this configuration, JavaScript modules located under "/js/lib/" use a fixed versioning strategy ("/v12/js/lib/mymodule.js"), while other resources still use the content one (<link href="/css/spring-2a2d595e6ed9a0b24f027f2b63b134d6.css"/>).

在这种配置下,位于“/js/lib/”下的 JavaScript 模块使用固定的版本控制策略(“/v12/js/lib/mymodule.js”) ,而其他资源仍然使用内容模块(< link href = "/css/spring-2a2d595e6ed9a0b24f027f2b63b134d6.css/>)。

See ResourceProperties for more supported options.

有关更多受支持的选项,请参见 ResourceProperties。

This feature has been thoroughly described in a dedicated blog post and in Spring Framework’s reference documentation.这个特性已经在一篇专门的博客文章和 Spring 框架的参考文档中得到了详细的描述。
1.3Welcome Page

Spring Boot supports both static and templated welcome pages. It first looks for an index.html file in the configured static content locations. If one is not found, it then looks for an index template. If either is found, it is automatically used as the welcome page of the application.

Spring Boot 支持静态和模板化欢迎页面。它首先在配置的静态内容位置中查找索引文件。如果没有找到,它就会查找索引模板。如果找到其中任何一个,它将自动用作应用程序的欢迎页面。

1.4Custom Favicon

As with other static resources, Spring Boot looks for a favicon.ico in the configured static content locations. If such a file is present, it is automatically used as the favicon of the application.

与其他静态资源一样,Spring Boot 在配置的静态内容位置中查找 favicon.ico。如果存在这样的文件,它将自动作为应用程序的图标使用。

Path Matching and Content Negotiation 路径匹配和内容协商

Spring MVC can map incoming HTTP requests to handlers by looking at the request path and matching it to the mappings defined in your application (for example, @GetMapping annotations on Controller methods).

Spring MVC 可以通过查看请求路径并将其与应用程序中定义的映射匹配(例如,Controller 方法上的@getmapping 注释) ,将传入的 HTTP 请求映射到处理程序。

Spring Boot chooses to disable suffix pattern matching by default, which means that requests like "GET /projects/spring-boot.json" won’t be matched to @GetMapping("/projects/spring-boot") mappings. This is considered as a best practice for Spring MVC applications. This feature was mainly useful in the past for HTTP clients which did not send proper “Accept” request headers; we needed to make sure to send the correct Content Type to the client. Nowadays, Content Negotiation is much more reliable.

Spring Boot 默认选择禁用后缀模式匹配,这意味着像“ GET/projects/Spring-Boot”这样的请求。Json”不会与@getmapping (”/projects/spring-boot”)映射匹配。这被认为是 Spring MVC 应用程序的最佳实践。过去,这个特性主要用于 HTTP 客户端,因为它没有发送正确的“ Accept”请求头; 我们需要确保向客户端发送正确的 Content Type。如今,内容协商更加可靠。

There are other ways to deal with HTTP clients that don’t consistently send proper “Accept” request headers. Instead of using suffix matching, we can use a query parameter to ensure that requests like "GET /projects/spring-boot?format=json" will be mapped to @GetMapping("/projects/spring-boot"):

还有其他方法来处理 HTTP 客户端,这些客户端没有始终如一地发送正确的“ Accept”请求头。与使用后缀匹配不同,我们可以使用查询参数来确保像“ GET/projects/spring-boot?Format = json”将被映射到@getmapping (”/projects/spring-boot”) :

spring.mvc.contentnegotiation.favor-parameter=true# We can change the parameter name, which is "format" by default:
# spring.mvc.contentnegotiation.parameter-name=myparam# We can also register additional file extensions/media types with:
spring.mvc.contentnegotiation.media-types.markdown=text/markdown

Suffix pattern matching is deprecated and will be removed in a future release. If you understand the caveats and would still like your application to use suffix pattern matching, the following configuration is required:

不推荐使用后缀模式匹配,将在未来的版本中删除。如果你明白这些注意事项,并且仍然希望你的应用程序使用后缀模式匹配,那么需要以下配置:

spring.mvc.contentnegotiation.favor-path-extension=true
spring.mvc.pathmatch.use-suffix-pattern=true

Alternatively, rather than open all suffix patterns, it’s more secure to only support registered suffix patterns:

或者,与其打开所有后缀模式,不如只支持注册后缀模式更安全:

spring.mvc.contentnegotiation.favor-path-extension=true
spring.mvc.pathmatch.use-registered-suffix-pattern=true# You can also register additional file extensions/media types with:
# spring.mvc.contentnegotiation.media-types.adoc=text/asciidoc
1.5ConfigurableWebBindingInitializer 可配置 webbindinginitializer

Spring MVC uses a WebBindingInitializer to initialize a WebDataBinder for a particular request. If you create your own ConfigurableWebBindingInitializer @Bean, Spring Boot automatically configures Spring MVC to use it.

Springmvc 使用 WebBindingInitializer 为特定请求初始化 WebDataBinder。如果您创建自己的 ConfigurableWebBindingInitializer@Bean,Spring Boot 将自动配置 Spring MVC 以使用它。

1.6Template Engines 模板引擎

As well as REST web services, you can also use Spring MVC to serve dynamic HTML content. Spring MVC supports a variety of templating technologies, including Thymeleaf, FreeMarker, and JSPs. Also, many other templating engines include their own Spring MVC integrations.

除了 REST web 服务之外,您还可以使用 springmvc 来提供动态 HTML 内容。Springmvc 支持各种模板技术,包括 Thymeleaf、 FreeMarker 和 jsp。此外,许多其他模板引擎也包括它们自己的 Spring MVC 集成。

Spring Boot includes auto-configuration support for the following templating engines:

Spring Boot 包括下列模板引擎的自动配置支持:

  • FreeMarker
  • Groovy
  • Thymeleaf
  • Mustache
If possible, JSPs should be avoided. There are several 如果可能的话,应该避免使用 jspknown limitations 已知的局限性 when using them with embedded servlet containers. 与内嵌的 servlet 容器一起使用时

When you use one of these templating engines with the default configuration, your templates are picked up automatically from src/main/resources/templates.

当您使用默认配置的这些模板引擎之一时,您的模板将自动从 src/main/resources/templates 中提取。

Depending on how you run your application, your IDE may order the classpath differently. Running your application in the IDE from its main method results in a different ordering than when you run your application by using Maven or Gradle or from its packaged jar. This can cause Spring Boot to fail to find the expected template. If you have this problem, you can reorder the classpath in the IDE to place the module’s classes and resources first. 根据运行应用程序的方式,IDE 可能会以不同的方式排列类路径。在 IDE 中从应用程序的 main 方法运行应用程序的结果与使用 Maven 或 Gradle 或从其打包 jar 运行应用程序的结果不同。这可能导致 Spring Boot 无法找到预期的模板。如果有这个问题,可以重新排列 IDE 中的类路径,以便将模块的类和资源放在第一位
1.7Error Handling 错误处理

By default, Spring Boot provides an /error mapping that handles all errors in a sensible way, and it is registered as a “global” error page in the servlet container. For machine clients, it produces a JSON response with details of the error, the HTTP status, and the exception message. For browser clients, there is a “whitelabel” error view that renders the same data in HTML format (to customize it, add a View that resolves to error).

默认情况下,Spring Boot 提供了一个/error 映射,以合理的方式处理所有错误,并将其注册为 servlet 容器中的“ global”错误页面。对于计算机客户机,它生成一个 JSON 响应,其中包含错误、 HTTP 状态和异常消息的详细信息。对于浏览器客户端,有一个“ whitelabel”错误视图,它以 HTML 格式呈现相同的数据(为了自定义它,添加一个解析为错误的视图)。

There are a number of server.error properties that can be set if you want to customize the default error handling behavior. See the “Server Properties” section of the Appendix.

如果您想自定义默认错误处理行为,可以设置许多 server.error 属性。请参阅附录的“服务器属性”部分。

To replace the default behavior completely, you can implement ErrorController and register a bean definition of that type or add a bean of type ErrorAttributes to use the existing mechanism but replace the contents.

要完全替换默认行为,可以实现 ErrorController 并注册该类型的 bean 定义,或者添加 ErrorAttributes 类型的 bean 来使用现有机制,但替换内容。

The 这个BasicErrorController can be used as a base class for a custom 可以用作自定义的基类ErrorController. This is particularly useful if you want to add a handler for a new content type (the default is to handle .如果您想为新的内容类型添加处理程序(默认是处理text/html specifically and provide a fallback for everything else). To do so, extend 要做到这一点,扩展BasicErrorController, add a public method with a ,添加一个带有@RequestMapping that has a 有一个produces attribute, and create a bean of your new type. 属性,并创建新类型的 bean

You can also define a class annotated with @ControllerAdvice to customize the JSON document to return for a particular controller and/or exception type, as shown in the following example:

您还可以定义一个带有@controlleradvice 注释的类来自定义 JSON 文档以返回特定的控制器和/或异常类型,如下面的示例所示:

@ControllerAdvice(basePackageClasses = AcmeController.class)
public class AcmeControllerAdvice extends ResponseEntityExceptionHandler {@ExceptionHandler(YourException.class)@ResponseBodyResponseEntity<?> handleControllerException(HttpServletRequest request, Throwable ex) {HttpStatus status = getStatus(request);return new ResponseEntity<>(new CustomErrorType(status.value(), ex.getMessage()), status);}private HttpStatus getStatus(HttpServletRequest request) {Integer statusCode = (Integer) request.getAttribute("javax.servlet.error.status_code");if (statusCode == null) {return HttpStatus.INTERNAL_SERVER_ERROR;}return HttpStatus.valueOf(statusCode);}}

In the preceding example, if YourException is thrown by a controller defined in the same package as AcmeController, a JSON representation of the CustomErrorType POJO is used instead of the ErrorAttributes representation.

在前面的示例中,如果 YourException 是由与 AcmeController 在同一个包中定义的控制器引发的,则使用 CustomErrorType POJO 的 JSON 表示代替 ErrorAttributes 表示。

1.8Custom Error Pages 自定义错误页面

If you want to display a custom HTML error page for a given status code, you can add a file to an /error directory. Error pages can either be static HTML (that is, added under any of the static resource directories) or be built by using templates. The name of the file should be the exact status code or a series mask.

如果希望显示给定状态代码的自定义 HTML 错误页面,可以向/error 目录添加文件。错误页面可以是静态 HTML (即添加到任何静态资源目录下) ,也可以通过使用模板构建。文件的名称应该是确切的状态代码或一系列掩码。

For example, to map 404 to a static HTML file, your directory structure would be as follows:

例如,要将404映射到一个静态 HTML 文件,您的目录结构如下:

src/+- main/+- java/|   + <source code>+- resources/+- public/+- error/|   +- 404.html+- <other public assets>

To map all 5xx errors by using a FreeMarker template, your directory structure would be as follows:

要使用 FreeMarker 模板映射所有5xx 错误,目录结构如下:

src/+- main/+- java/|   + <source code>+- resources/+- templates/+- error/|   +- 5xx.ftlh+- <other templates>

For more complex mappings, you can also add beans that implement the ErrorViewResolver interface, as shown in the following example:

对于更复杂的映射,您还可以添加实现 ErrorViewResolver 接口的 bean,如下例所示:

public class MyErrorViewResolver implements ErrorViewResolver {@Overridepublic ModelAndView resolveErrorView(HttpServletRequest request,HttpStatus status, Map<String, Object> model) {// Use the request or status to optionally return a ModelAndViewreturn ...}}

You can also use regular Spring MVC features such as @ExceptionHandler methods and @ControllerAdvice. The ErrorController then picks up any unhandled exceptions.

您还可以使用常规的 Spring MVC 特性,比如@exceptionhandler 方法和@controlleradvice。然后 ErrorController 会拾取任何未处理的异常。

Mapping Error Pages outside of Spring MVC 映射 Spring MVC 外部的错误页面

For applications that do not use Spring MVC, you can use the ErrorPageRegistrar interface to directly register ErrorPages. This abstraction works directly with the underlying embedded servlet container and works even if you do not have a Spring MVC DispatcherServlet.

对于不使用 springmvc 的应用程序,可以使用 ErrorPageRegistrar 接口直接注册 ErrorPages。这个抽象直接与底层的嵌入式 servlet 容器一起工作,即使您没有 Spring MVC DispatcherServlet 也可以工作。

@Bean
public ErrorPageRegistrar errorPageRegistrar(){return new MyErrorPageRegistrar();
}// ...private static class MyErrorPageRegistrar implements ErrorPageRegistrar {@Overridepublic void registerErrorPages(ErrorPageRegistry registry) {registry.addErrorPages(new ErrorPage(HttpStatus.BAD_REQUEST, "/400"));}}
If you register an 如果你注册了一个ErrorPage with a path that ends up being handled by a 这条路最终被一个Filter (as is common with some non-Spring web frameworks, like Jersey and Wicket), then the (正如一些非 spring web 框架(如 Jersey 和 Wicket)常见的那样) ,然后Filter has to be explicitly registered as an 必须明确注册为ERROR dispatcher, as shown in the following example: 分配器,如下面的示例所示:
@Bean
public FilterRegistrationBean myFilter() {FilterRegistrationBean registration = new FilterRegistrationBean();registration.setFilter(new MyFilter());...registration.setDispatcherTypes(EnumSet.allOf(DispatcherType.class));return registration;
}

Note that the default FilterRegistrationBean does not include the ERROR dispatcher type.

注意,默认的 FilterRegistrationBean 不包含 ERROR 调度器类型。

查看全文
如若内容造成侵权/违法违规/事实不符,请联系编程学习网邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

相关文章

  1. SAS学习笔记

    入门&#xff0c;编程环境 没在学校系统学习过SAS,接触SAS也是最近两个月的事情&#xff0c;SAS官方给的学习资源很多&#xff0c;有些甚至还专门安排成课程的形式&#xff0c;有视频和选择题自测&#xff0c;课后练习自己做&#xff0c;在官网注册好账号&#xff0c;根据提示…...

    2024/4/20 20:22:41
  2. 【机器学习】生成对抗网络 GAN

    文章目录GAN能干什么&#xff1f;GAN的设计初衷GAN 的基本原理&#xff08;大白话&#xff09;生成对抗网络&#xff08;GAN&#xff09;由2个重要的部分构成训练过程GAN的总结GAN的提出&#xff1a;“Generative Adversarial Networks”&#xff08;2014NIPS&#xff09;GAN的…...

    2024/4/23 3:10:10
  3. day44 数据库

    存储数据的演变过程 随意的存到一个文件中、数据格式也是千差万别的完全取决于我们自己 """ # 小李 jason|123|NB # 小王 egon-123-DBJ # 小红 tank~123~hecha """软件开发目录规范 限制了存储数据的具体位置 """ bin conf core …...

    2024/4/21 16:56:02
  4. STM32实现LED闪烁——基于HAL库

    一、安装STM32CubeMX 官网地址&#xff1a;下载链接 具体过程可参考博客:STM32CubeMX安装教程 二、配置STM32CubeMX 打开STM32CubeMX&#xff0c;选择Help下的Manager embedded software packages 芯片选择STM32F1 选择INstall Now,此过程需要联网 三、创建工程 点击Fil…...

    2024/4/21 16:56:01
  5. N卡-50Hx

    50Hx 核心:1000 显存:1500 算力:54...

    2024/4/21 16:56:00
  6. 2021年10月26日 计组

    1. 指令格式 1.1 指令格式的定义 1.2 指令格式 1.2.1 扩展地址码 1.2.3 扩展操作码 1.2.4 总结 2. 指令寻址 2.1 数据存放 2.2 边界对齐存储 2.3 两种指令寻址方式 2.4 总结 3. 数据寻址 根据某种寻址方式的要求把形式地址转化为存储器中的有效地址 3.1 操作数类型 3.2 数据…...

    2024/4/21 16:56:00
  7. 第一天美多商城项目准备

    美多商城1.开发流程2.需求分析2. 架构设计3.数据库设计4. 集成测试5.创建工程及配置6.配置开发环境7.配置Jinja2模板引擎8.配置MySQL数据库9.配置Redis数据库10.配置工程日志11.配置前端静态文件1.开发流程 2.需求分析 需求分析原因&#xff1a; 可以整体的了解项目的业务流程和…...

    2024/4/21 11:54:20
  8. 【程序人生】2021.10.26随笔 - 远离程序员强迫症

    1 5年经验以上的程序员&#xff0c;不要再和刚毕业的小孩子一样&#xff0c;不要再纠结于代码的细枝末节 要有自己的目标&#xff0c;要么学习一些专业的技术&#xff0c;要么就深耕某个行业的业务&#xff0c;用已有的技术把业务功能和细节做到极致 专业的技术需要时间积累…...

    2024/4/21 16:55:57
  9. postman Could not send request

    我的原因是实验室的电脑 ip 变了&#xff0c;因为实验室定期重新分配ip&#xff0c;所以我用以前的 ip 就不能发送request了 解决&#xff1a; cmd 下 ipconfig 查看自己的ip 然后写request接口...

    2024/4/21 16:55:59
  10. 2021-10-26每日刷题打卡

    一、LeetCode:94. 二叉树的中序遍历 (1)问题描述 给定一个二叉树的根节点 root &#xff0c;返回它的 中序 遍历。 示例 1&#xff1a; 输入&#xff1a;root [1,null,2,3] 输出&#xff1a;[1,3,2] 示例 2&#xff1a; 输入&#xff1a;root [] 输出&#xff1a;[] 示例 3&…...

    2024/4/25 17:27:03
  11. 乘法逆元总结

    P3811 【模板】乘法逆元 好的blog 文章目录目标4种方法扩展欧几里得费马小定理线性关系阶乘#include <bits/stdc.h> using namespace std; long long n,p; long long inv[3000001],fac[3000001],finv[3000001]; typedef long long ll;void xianxing()//线性 {inv[1] 1;…...

    2024/4/26 14:06:36
  12. 2021-10-26第二章 java基础(第二部分)

    1.运算符 1.1算术运算符: - * \ % -- 1.1.1 "" 加法运算&#xff1a;数值加数值&#xff1b; 数值加字符 int a10; aa1;aab(b参与运算的应该是b的Acsll码值) 连接&#xff1a;字符串数值&#xff1b;字符串字符串 System.out.println("abc"3)&#…...

    2024/4/21 16:55:54
  13. HDFS写数据流流程

    1.客户端通过调用&#xff0c;分布式文件系统对象中的Create()创建一个文件&#xff0c;分布式文件系统通过RPC调用的NN中的文件系统命名空间创建一个新文件。 2.NN通过验证&#xff0c;确保请求客户端拥有创建文件的权限&#xff0c;新的文件不存在文件系统中&#xff0c;若通…...

    2024/4/20 14:10:13
  14. 学习中遇到的一些Linux常用命令

    学习中遇到的一些Linux常用命令 这是我在本学期目前为止学到的Linux常用命令&#xff0c;写这个笔记是为了方便我自己期末复习&#xff0c;和以后参考&#xff0c;后面会时不时的更新&#xff0c;可能有错误的地方欢迎指正 一般操作 查看自己所输入的所有历史命令&#xff1…...

    2024/4/20 14:10:11
  15. 2021.10.26,内容:标准输入流

    打印输出到“标准输出流”&#xff08;即控制台窗口&#xff09;是一件非常简单的事情。 在我们学习的java的第一个程序时&#xff0c;我们已经接触了标准输出流&#xff0c;并在控制台中输出了“Hello World&#xff01;”。{ System.out.println(“Hello World!”); } 在这里…...

    2024/4/20 14:10:10
  16. 组合数学 - 错排公式

    例题...

    2024/4/20 14:10:09
  17. Excel表格导入时,如何将中文key转为英文key

    1.为什么要这样做 在我们导入excel表格后&#xff0c;我们需要将数据导入至服务器&#xff0c;然而这些表格为了方便阅读基本上都是使用中文书写&#xff0c;但是服务器并不能识别这些中文&#xff0c;所以就需要我们将这些中文转换成英文 例如 2.转换的方法 思路&#xff1…...

    2024/4/24 19:19:57
  18. JDBC封装学生管理系统

    JDBC封装学生管理系统com.bennett.modelcom.bennett.daoStudentDaocom.bennett.utilcom.bennett.dao.testJDBC封装的过程&#xff1a; 1、引入驱动jar;(ohdbc6.jar,) 该jar包在oracle数据库自带的&#xff0c;具体路径如下&#xff1a; D:\Softwares\OracleXE\app\oracle\produ…...

    2024/4/21 16:55:51
  19. C++学习笔记(Day16 第十章迭代器)

    迭代器 迭代器是算法和容器的桥梁 迭代器用作访问容器中的元素 算法不直接操作容器中的数据&#xff0c;而是通过迭代器间接操作 算法和容器独立 增加新的算法&#xff0c;无需影响容器的实现 增加新的容器&#xff0c;原有的算法也能适用 输入流迭代器和输出流迭代器 输入…...

    2024/4/26 10:12:29
  20. python--递归实现m个数字里选n个进行排列

    #以4选3为例 a[1,2,3,4] b[None]*3 def three(j):if j 3:#if b[0]!b[1] and b[1]!b[2] and b[0]!b[2]: 若希望元素不重复&#xff0c;可加上此段print(b)else:for i in range(len(a)):b[j]a[i]three(j1) three(0) 学习过程记录.1...

    2024/4/25 11:35:52

最新文章

  1. C语言随笔集

    注意 strlen 和 sizeof 的区别 strlen计算的是第一个 ‘\0’ 前面的字符的个数sizeof计算的是占用的内存空间的大小只和定义时有关C语言中,输出double类型(双精度)和float(单精度)时, 编译器默认精确到小数点后六位输出 默认输出的是6位小数,不足6位,以0补齐,超过6位按…...

    2024/4/27 11:59:39
  2. 梯度消失和梯度爆炸的一些处理方法

    在这里是记录一下梯度消失或梯度爆炸的一些处理技巧。全当学习总结了如有错误还请留言&#xff0c;在此感激不尽。 权重和梯度的更新公式如下&#xff1a; w w − η ⋅ ∇ w w w - \eta \cdot \nabla w ww−η⋅∇w 个人通俗的理解梯度消失就是网络模型在反向求导的时候出…...

    2024/3/20 10:50:27
  3. Unity核心学习

    目录 认识模型的制作流程模型的制作过程 2D相关图片导入设置图片导入概述纹理类型设置纹理形状设置纹理高级设置纹理平铺拉伸设置纹理平台打包相关设置 SpriteSprite Editor——Single图片编辑Sprite Editor——Multiple图片编辑Sprite Editor——Polygon图片编辑SpriteRendere…...

    2024/4/24 7:49:17
  4. Redis -- 缓存雪崩问题

    缓存雪崩是指在同一时段大量的缓存key同时失效或者Redis服务宕机&#xff0c;导致大量请求到达数据库&#xff0c;带来巨大压力。 可能原因 : 同一时间大量的key到期 ; 解决方案&#xff1a; 给不同的Key的TTL添加随机值 利用Redis集群提高服务的可用性 给缓存业务添加降…...

    2024/4/24 17:01:06
  5. 【外汇早评】美通胀数据走低,美元调整

    原标题:【外汇早评】美通胀数据走低,美元调整昨日美国方面公布了新一期的核心PCE物价指数数据,同比增长1.6%,低于前值和预期值的1.7%,距离美联储的通胀目标2%继续走低,通胀压力较低,且此前美国一季度GDP初值中的消费部分下滑明显,因此市场对美联储后续更可能降息的政策…...

    2024/4/26 18:09:39
  6. 【原油贵金属周评】原油多头拥挤,价格调整

    原标题:【原油贵金属周评】原油多头拥挤,价格调整本周国际劳动节,我们喜迎四天假期,但是整个金融市场确实流动性充沛,大事频发,各个商品波动剧烈。美国方面,在本周四凌晨公布5月份的利率决议和新闻发布会,维持联邦基金利率在2.25%-2.50%不变,符合市场预期。同时美联储…...

    2024/4/26 20:12:18
  7. 【外汇周评】靓丽非农不及疲软通胀影响

    原标题:【外汇周评】靓丽非农不及疲软通胀影响在刚结束的周五,美国方面公布了新一期的非农就业数据,大幅好于前值和预期,新增就业重新回到20万以上。具体数据: 美国4月非农就业人口变动 26.3万人,预期 19万人,前值 19.6万人。 美国4月失业率 3.6%,预期 3.8%,前值 3…...

    2024/4/26 23:05:52
  8. 【原油贵金属早评】库存继续增加,油价收跌

    原标题:【原油贵金属早评】库存继续增加,油价收跌周三清晨公布美国当周API原油库存数据,上周原油库存增加281万桶至4.692亿桶,增幅超过预期的74.4万桶。且有消息人士称,沙特阿美据悉将于6月向亚洲炼油厂额外出售更多原油,印度炼油商预计将每日获得至多20万桶的额外原油供…...

    2024/4/27 4:00:35
  9. 【外汇早评】日本央行会议纪要不改日元强势

    原标题:【外汇早评】日本央行会议纪要不改日元强势近两日日元大幅走强与近期市场风险情绪上升,避险资金回流日元有关,也与前一段时间的美日贸易谈判给日本缓冲期,日本方面对汇率问题也避免继续贬值有关。虽然今日早间日本央行公布的利率会议纪要仍然是支持宽松政策,但这符…...

    2024/4/25 18:39:22
  10. 【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响

    原标题:【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响近日伊朗局势升温,导致市场担忧影响原油供给,油价试图反弹。此时OPEC表态稳定市场。据消息人士透露,沙特6月石油出口料将低于700万桶/日,沙特已经收到石油消费国提出的6月份扩大出口的“适度要求”,沙特将满…...

    2024/4/25 18:39:22
  11. 【外汇早评】美欲与伊朗重谈协议

    原标题:【外汇早评】美欲与伊朗重谈协议美国对伊朗的制裁遭到伊朗的抗议,昨日伊朗方面提出将部分退出伊核协议。而此行为又遭到欧洲方面对伊朗的谴责和警告,伊朗外长昨日回应称,欧洲国家履行它们的义务,伊核协议就能保证存续。据传闻伊朗的导弹已经对准了以色列和美国的航…...

    2024/4/26 21:56:58
  12. 【原油贵金属早评】波动率飙升,市场情绪动荡

    原标题:【原油贵金属早评】波动率飙升,市场情绪动荡因中美贸易谈判不安情绪影响,金融市场各资产品种出现明显的波动。随着美国与中方开启第十一轮谈判之际,美国按照既定计划向中国2000亿商品征收25%的关税,市场情绪有所平复,已经开始接受这一事实。虽然波动率-恐慌指数VI…...

    2024/4/27 9:01:45
  13. 【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试

    原标题:【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试美国和伊朗的局势继续升温,市场风险情绪上升,避险黄金有向上突破阻力的迹象。原油方面稍显平稳,近期美国和OPEC加大供给及市场需求回落的影响,伊朗局势并未推升油价走强。近期中美贸易谈判摩擦再度升级,美国对中…...

    2024/4/26 16:00:35
  14. 【原油贵金属早评】市场情绪继续恶化,黄金上破

    原标题:【原油贵金属早评】市场情绪继续恶化,黄金上破周初中国针对于美国加征关税的进行的反制措施引发市场情绪的大幅波动,人民币汇率出现大幅的贬值动能,金融市场受到非常明显的冲击。尤其是波动率起来之后,对于股市的表现尤其不安。隔夜美国股市出现明显的下行走势,这…...

    2024/4/25 18:39:16
  15. 【外汇早评】美伊僵持,风险情绪继续升温

    原标题:【外汇早评】美伊僵持,风险情绪继续升温昨日沙特两艘油轮再次发生爆炸事件,导致波斯湾局势进一步恶化,市场担忧美伊可能会出现摩擦生火,避险品种获得支撑,黄金和日元大幅走强。美指受中美贸易问题影响而在低位震荡。继5月12日,四艘商船在阿联酋领海附近的阿曼湾、…...

    2024/4/25 18:39:16
  16. 【原油贵金属早评】贸易冲突导致需求低迷,油价弱势

    原标题:【原油贵金属早评】贸易冲突导致需求低迷,油价弱势近日虽然伊朗局势升温,中东地区几起油船被袭击事件影响,但油价并未走高,而是出于调整结构中。由于市场预期局势失控的可能性较低,而中美贸易问题导致的全球经济衰退风险更大,需求会持续低迷,因此油价调整压力较…...

    2024/4/26 19:03:37
  17. 氧生福地 玩美北湖(上)——为时光守候两千年

    原标题:氧生福地 玩美北湖(上)——为时光守候两千年一次说走就走的旅行,只有一张高铁票的距离~ 所以,湖南郴州,我来了~ 从广州南站出发,一个半小时就到达郴州西站了。在动车上,同时改票的南风兄和我居然被分到了一个车厢,所以一路非常愉快地聊了过来。 挺好,最起…...

    2024/4/26 22:01:59
  18. 氧生福地 玩美北湖(中)——永春梯田里的美与鲜

    原标题:氧生福地 玩美北湖(中)——永春梯田里的美与鲜一觉醒来,因为大家太爱“美”照,在柳毅山庄去寻找龙女而错过了早餐时间。近十点,向导坏坏还是带着饥肠辘辘的我们去吃郴州最富有盛名的“鱼头粉”。说这是“十二分推荐”,到郴州必吃的美食之一。 哇塞!那个味美香甜…...

    2024/4/25 18:39:14
  19. 氧生福地 玩美北湖(下)——奔跑吧骚年!

    原标题:氧生福地 玩美北湖(下)——奔跑吧骚年!让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 啊……啊……啊 两…...

    2024/4/26 23:04:58
  20. 扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!

    原标题:扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!扒开伪装医用面膜,翻六倍价格宰客!当行业里的某一品项火爆了,就会有很多商家蹭热度,装逼忽悠,最近火爆朋友圈的医用面膜,被沾上了污点,到底怎么回事呢? “比普通面膜安全、效果好!痘痘、痘印、敏感肌都能用…...

    2024/4/25 2:10:52
  21. 「发现」铁皮石斛仙草之神奇功效用于医用面膜

    原标题:「发现」铁皮石斛仙草之神奇功效用于医用面膜丽彦妆铁皮石斛医用面膜|石斛多糖无菌修护补水贴19大优势: 1、铁皮石斛:自唐宋以来,一直被列为皇室贡品,铁皮石斛生于海拔1600米的悬崖峭壁之上,繁殖力差,产量极低,所以古代仅供皇室、贵族享用 2、铁皮石斛自古民间…...

    2024/4/25 18:39:00
  22. 丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者

    原标题:丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者【公司简介】 广州华彬企业隶属香港华彬集团有限公司,专注美业21年,其旗下品牌: 「圣茵美」私密荷尔蒙抗衰,产后修复 「圣仪轩」私密荷尔蒙抗衰,产后修复 「花茵莳」私密荷尔蒙抗衰,产后修复 「丽彦妆」专注医学护…...

    2024/4/26 19:46:12
  23. 广州械字号面膜生产厂家OEM/ODM4项须知!

    原标题:广州械字号面膜生产厂家OEM/ODM4项须知!广州械字号面膜生产厂家OEM/ODM流程及注意事项解读: 械字号医用面膜,其实在我国并没有严格的定义,通常我们说的医美面膜指的应该是一种「医用敷料」,也就是说,医用面膜其实算作「医疗器械」的一种,又称「医用冷敷贴」。 …...

    2024/4/27 11:43:08
  24. 械字号医用眼膜缓解用眼过度到底有无作用?

    原标题:械字号医用眼膜缓解用眼过度到底有无作用?医用眼膜/械字号眼膜/医用冷敷眼贴 凝胶层为亲水高分子材料,含70%以上的水分。体表皮肤温度传导到本产品的凝胶层,热量被凝胶内水分子吸收,通过水分的蒸发带走大量的热量,可迅速地降低体表皮肤局部温度,减轻局部皮肤的灼…...

    2024/4/27 8:32:30
  25. 配置失败还原请勿关闭计算机,电脑开机屏幕上面显示,配置失败还原更改 请勿关闭计算机 开不了机 这个问题怎么办...

    解析如下&#xff1a;1、长按电脑电源键直至关机&#xff0c;然后再按一次电源健重启电脑&#xff0c;按F8健进入安全模式2、安全模式下进入Windows系统桌面后&#xff0c;按住“winR”打开运行窗口&#xff0c;输入“services.msc”打开服务设置3、在服务界面&#xff0c;选中…...

    2022/11/19 21:17:18
  26. 错误使用 reshape要执行 RESHAPE,请勿更改元素数目。

    %读入6幅图像&#xff08;每一幅图像的大小是564*564&#xff09; f1 imread(WashingtonDC_Band1_564.tif); subplot(3,2,1),imshow(f1); f2 imread(WashingtonDC_Band2_564.tif); subplot(3,2,2),imshow(f2); f3 imread(WashingtonDC_Band3_564.tif); subplot(3,2,3),imsho…...

    2022/11/19 21:17:16
  27. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机...

    win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”问题的解决方法在win7系统关机时如果有升级系统的或者其他需要会直接进入一个 等待界面&#xff0c;在等待界面中我们需要等待操作结束才能关机&#xff0c;虽然这比较麻烦&#xff0c;但是对系统进行配置和升级…...

    2022/11/19 21:17:15
  28. 台式电脑显示配置100%请勿关闭计算机,“准备配置windows 请勿关闭计算机”的解决方法...

    有不少用户在重装Win7系统或更新系统后会遇到“准备配置windows&#xff0c;请勿关闭计算机”的提示&#xff0c;要过很久才能进入系统&#xff0c;有的用户甚至几个小时也无法进入&#xff0c;下面就教大家这个问题的解决方法。第一种方法&#xff1a;我们首先在左下角的“开始…...

    2022/11/19 21:17:14
  29. win7 正在配置 请勿关闭计算机,怎么办Win7开机显示正在配置Windows Update请勿关机...

    置信有很多用户都跟小编一样遇到过这样的问题&#xff0c;电脑时发现开机屏幕显现“正在配置Windows Update&#xff0c;请勿关机”(如下图所示)&#xff0c;而且还需求等大约5分钟才干进入系统。这是怎样回事呢&#xff1f;一切都是正常操作的&#xff0c;为什么开时机呈现“正…...

    2022/11/19 21:17:13
  30. 准备配置windows 请勿关闭计算机 蓝屏,Win7开机总是出现提示“配置Windows请勿关机”...

    Win7系统开机启动时总是出现“配置Windows请勿关机”的提示&#xff0c;没过几秒后电脑自动重启&#xff0c;每次开机都这样无法进入系统&#xff0c;此时碰到这种现象的用户就可以使用以下5种方法解决问题。方法一&#xff1a;开机按下F8&#xff0c;在出现的Windows高级启动选…...

    2022/11/19 21:17:12
  31. 准备windows请勿关闭计算机要多久,windows10系统提示正在准备windows请勿关闭计算机怎么办...

    有不少windows10系统用户反映说碰到这样一个情况&#xff0c;就是电脑提示正在准备windows请勿关闭计算机&#xff0c;碰到这样的问题该怎么解决呢&#xff0c;现在小编就给大家分享一下windows10系统提示正在准备windows请勿关闭计算机的具体第一种方法&#xff1a;1、2、依次…...

    2022/11/19 21:17:11
  32. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”的解决方法...

    今天和大家分享一下win7系统重装了Win7旗舰版系统后&#xff0c;每次关机的时候桌面上都会显示一个“配置Windows Update的界面&#xff0c;提示请勿关闭计算机”&#xff0c;每次停留好几分钟才能正常关机&#xff0c;导致什么情况引起的呢&#xff1f;出现配置Windows Update…...

    2022/11/19 21:17:10
  33. 电脑桌面一直是清理请关闭计算机,windows7一直卡在清理 请勿关闭计算机-win7清理请勿关机,win7配置更新35%不动...

    只能是等着&#xff0c;别无他法。说是卡着如果你看硬盘灯应该在读写。如果从 Win 10 无法正常回滚&#xff0c;只能是考虑备份数据后重装系统了。解决来方案一&#xff1a;管理员运行cmd&#xff1a;net stop WuAuServcd %windir%ren SoftwareDistribution SDoldnet start WuA…...

    2022/11/19 21:17:09
  34. 计算机配置更新不起,电脑提示“配置Windows Update请勿关闭计算机”怎么办?

    原标题&#xff1a;电脑提示“配置Windows Update请勿关闭计算机”怎么办&#xff1f;win7系统中在开机与关闭的时候总是显示“配置windows update请勿关闭计算机”相信有不少朋友都曾遇到过一次两次还能忍但经常遇到就叫人感到心烦了遇到这种问题怎么办呢&#xff1f;一般的方…...

    2022/11/19 21:17:08
  35. 计算机正在配置无法关机,关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机...

    关机提示 windows7 正在配置windows 请勿关闭计算机 &#xff0c;然后等了一晚上也没有关掉。现在电脑无法正常关机以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;关机提示 windows7 正在配…...

    2022/11/19 21:17:05
  36. 钉钉提示请勿通过开发者调试模式_钉钉请勿通过开发者调试模式是真的吗好不好用...

    钉钉请勿通过开发者调试模式是真的吗好不好用 更新时间:2020-04-20 22:24:19 浏览次数:729次 区域: 南阳 > 卧龙 列举网提醒您:为保障您的权益,请不要提前支付任何费用! 虚拟位置外设器!!轨迹模拟&虚拟位置外设神器 专业用于:钉钉,外勤365,红圈通,企业微信和…...

    2022/11/19 21:17:05
  37. 配置失败还原请勿关闭计算机怎么办,win7系统出现“配置windows update失败 还原更改 请勿关闭计算机”,长时间没反应,无法进入系统的解决方案...

    前几天班里有位学生电脑(windows 7系统)出问题了&#xff0c;具体表现是开机时一直停留在“配置windows update失败 还原更改 请勿关闭计算机”这个界面&#xff0c;长时间没反应&#xff0c;无法进入系统。这个问题原来帮其他同学也解决过&#xff0c;网上搜了不少资料&#x…...

    2022/11/19 21:17:04
  38. 一个电脑无法关闭计算机你应该怎么办,电脑显示“清理请勿关闭计算机”怎么办?...

    本文为你提供了3个有效解决电脑显示“清理请勿关闭计算机”问题的方法&#xff0c;并在最后教给你1种保护系统安全的好方法&#xff0c;一起来看看&#xff01;电脑出现“清理请勿关闭计算机”在Windows 7(SP1)和Windows Server 2008 R2 SP1中&#xff0c;添加了1个新功能在“磁…...

    2022/11/19 21:17:03
  39. 请勿关闭计算机还原更改要多久,电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机怎么办...

    许多用户在长期不使用电脑的时候&#xff0c;开启电脑发现电脑显示&#xff1a;配置windows更新失败&#xff0c;正在还原更改&#xff0c;请勿关闭计算机。。.这要怎么办呢&#xff1f;下面小编就带着大家一起看看吧&#xff01;如果能够正常进入系统&#xff0c;建议您暂时移…...

    2022/11/19 21:17:02
  40. 还原更改请勿关闭计算机 要多久,配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以...

    配置windows update失败 还原更改 请勿关闭计算机&#xff0c;电脑开机后一直显示以以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;配置windows update失败 还原更改 请勿关闭计算机&#x…...

    2022/11/19 21:17:01
  41. 电脑配置中请勿关闭计算机怎么办,准备配置windows请勿关闭计算机一直显示怎么办【图解】...

    不知道大家有没有遇到过这样的一个问题&#xff0c;就是我们的win7系统在关机的时候&#xff0c;总是喜欢显示“准备配置windows&#xff0c;请勿关机”这样的一个页面&#xff0c;没有什么大碍&#xff0c;但是如果一直等着的话就要两个小时甚至更久都关不了机&#xff0c;非常…...

    2022/11/19 21:17:00
  42. 正在准备配置请勿关闭计算机,正在准备配置windows请勿关闭计算机时间长了解决教程...

    当电脑出现正在准备配置windows请勿关闭计算机时&#xff0c;一般是您正对windows进行升级&#xff0c;但是这个要是长时间没有反应&#xff0c;我们不能再傻等下去了。可能是电脑出了别的问题了&#xff0c;来看看教程的说法。正在准备配置windows请勿关闭计算机时间长了方法一…...

    2022/11/19 21:16:59
  43. 配置失败还原请勿关闭计算机,配置Windows Update失败,还原更改请勿关闭计算机...

    我们使用电脑的过程中有时会遇到这种情况&#xff0c;当我们打开电脑之后&#xff0c;发现一直停留在一个界面&#xff1a;“配置Windows Update失败&#xff0c;还原更改请勿关闭计算机”&#xff0c;等了许久还是无法进入系统。如果我们遇到此类问题应该如何解决呢&#xff0…...

    2022/11/19 21:16:58
  44. 如何在iPhone上关闭“请勿打扰”

    Apple’s “Do Not Disturb While Driving” is a potentially lifesaving iPhone feature, but it doesn’t always turn on automatically at the appropriate time. For example, you might be a passenger in a moving car, but your iPhone may think you’re the one dri…...

    2022/11/19 21:16:57