Java EE 企业应用系统开发 - HTTP 响应处理编程响应对象 响应对象功能和方法 HTTP 响应的内容 在 Web 服务器接收请求处理后,向客户端发送 HTTP 响应 (Response)。 O 响应的内容 ▶ 响应状态(Status Code) ▶ 响应头(Response Header) ▶ 响应体(Response Body) 大纲 HTTP 响应的内容 HTTP 响应对象 响应对象功能和方法 HTTP 响应状态行 表明响应的状态信息,如成功、失败、错误。 告知客户可以接收的字符集:Accept-Charset 3. 响应的字符编码集:Accept-Encoding 4. 响应体的 MIME 类型:Content-Type 5. 响应体的语言类型:Context-Language 6. 响应体的长度和字节数:Content-Length 7. 通知客户端到期时间:Expires 8. 缓存情况:Cache-Control 9. 重定向到另一个 URL 向客户端发送指定的错误信息码,可以是任意定义的整数。 1 response.setCharacterEncoding("GBK"); 2 response.sendError(580); O public void sendError(int sc, String msg) throws IOException 向客户端发送指定的错误信息码和自定义状态消息。 1 response.setCharacterEncoding("GBK");0 码力 | 26 页 | 575.28 KB | 1 年前3
Spring Framwork Web on Servlet Stack v5.3.36 SNAPSHOT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1.1. Context Hierarchy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . application configuration AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext(); context.register(AppConfig.class); // Create and register the DispatcherServlet DispatcherServlet DispatcherServlet servlet = new DispatcherServlet(context); ServletRegistration.Dynamic registration = servletContext.addServlet("app", servlet); registration.0 码力 | 259 页 | 3.58 MB | 1 年前3
Spring Framework Reference Documentation 4.3.26.RELEASEcontexts Constructing ClassPathXmlApplicationContext instances - shortcuts Wildcards in application context constructor resource paths Ant-style Patterns Implications on portability The classpath*: prefix General testing utilities Spring MVC 15. Integration Testing Overview Goals of Integration Testing Context management and caching Dependency Injection of test fixtures Transaction management Support classes Spring TestContext Framework Key abstractions TestContext TestContextManager TestExecutionListener Context Loaders Bootstrapping the TestContext framework TestExecutionListener configuration Registering0 码力 | 1323 页 | 4.08 MB | 1 年前3
Spring Framework Reference Documentation v4.3.2contexts Constructing ClassPathXmlApplicationContext instances - shortcuts Wildcards in application context constructor resource paths Ant-style Patterns Implications on portability The Classpath*: portability General testing utilities Spring MVC 15. Integration Testing Overview Goals of Integration Testing Context management and caching Dependency Injection of test fixtures Transaction management Support classes Spring TestContext Framework Key abstractions TestContext TestContextManager TestExecutionListener Context Loaders Bootstrapping the TestContext framework TestExecutionListener configuration Registering0 码力 | 1311 页 | 4.07 MB | 1 年前3
Spring Framework Reference Documentation 4.3.26.RELEASEConstructing ClassPathXmlApplicationContext instances - shortcuts .......... 168 Wildcards in application context constructor resource paths ............................... 168 Ant-style Patterns .............. Integration Testing ............................................................................ 296 Context management and caching .................................................................. 296 Dependency TestExecutionListener ............................................................................. 309 Context Loaders ..................................................................................... 3090 码力 | 916 页 | 5.52 MB | 1 年前3
Spring Framework Reference Documentation v4.3.2Constructing ClassPathXmlApplicationContext instances - shortcuts .......... 160 Wildcards in application context constructor resource paths ............................... 160 Ant-style Patterns .............. Integration Testing ............................................................................ 289 Context management and caching .................................................................. 289 Dependency TestExecutionListener ............................................................................. 302 Context Loaders ..................................................................................... 3020 码力 | 907 页 | 5.46 MB | 1 年前3
Spring Framwork Testing v5.3.36 SNAPSHOT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.2.1. Context Management and Caching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Context Loaders. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 3.5.6. Context Management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 Context Configuration with XML resources0 码力 | 193 页 | 2.53 MB | 1 年前3
Spring Boot 2.7.13 Reference Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 Simulating a Web Context. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 Servlet Context Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491 13.10.3. Custom Context Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .0 码力 | 871 页 | 15.57 MB | 1 年前3
Spring Boot 2.7.17-SNAPSHOT Reference Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 Simulating a Web Context. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 Servlet Context Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495 13.10.3. Custom Context Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .0 码力 | 876 页 | 15.66 MB | 1 年前3
Spring Boot 2.7.16-SNAPSHOT Reference Guide. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 Simulating a Web Context. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 Servlet Context Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495 13.10.3. Custom Context Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .0 码力 | 876 页 | 15.65 MB | 1 年前3
共 390 条
- 1
- 2
- 3
- 4
- 5
- 6
- 39













