Java 应用系统开发 - ServletContext 和 Web 配置Servlet 配置对象 ServletConfig Java EE 为取得 Servlet 的配置信息,提供一个 Servlet 配置对象 API。 该对象在 Servlet 初始化阶段由 Web 容器实例化,并将当前 Servlet 的配置数据写入到此对象,供 Servlet 读取使用。 ## 配置对象的类型和取得 配置对象类型 java.servlet.ServletConfig 是一个接口,具体实现类由容器厂商实现。 是一个接口,具体实现类由容器厂商实现。 ServletConfig 对象在 Servlet 的 init 方法中取得,由 Web 容器以参数方式注入到 Servlet: private ServletConfig config = null; public void init(ServletConfig config) throws ServletException { super.init(config); config; } 1. 要取得 ServletConfig 对象需要重写 init 方法,并传递 ServletConfig 参数。然后在 doGet 和 doPost 方法中即可以使用 config 对象。 2. 与 ServletContext 和 HttpSession 对象不同,Web 容器为每个 Servlet 实例创建一个 ServletConfig 对象,不同 Servlet 之间无法共享此对象。0 码力 | 33 页 | 668.91 KB | 2 年前3
《Java 应用与开发》课程讲义 - 王晓东..... 255 20.3 Servlet 配置对象 ..... 255 20.3.1 Servlet 配置对象 ServletConfig ..... 255 20.3.2 配置对象的类型和取得 ..... 255 20.3.3 ServletConfig 功能和方法 ..... 256 20.4 转发和重定向 ..... 257 20.4.1 Web 跳转方式 ... 方法完成初始化功能,一般将耗时的连接数据库和打开外部资源文件的操作放在 init 方法中。 init 方法在 Web 容器创建 Servlet 对象后立即执行,且只执行一次。 public void init(ServletConfig config) throws ServletException { super.init(config); // 这里放置初始化工作代码. } 在 init 方法中使用900 ### 20.3 Servlet 配置对象 #### 20.3.1 Servlet 配置对象 ServletConfig - Java EE 为取得 Servlet 的配置信息,提供一个 Servlet 配置对象 API。 - 该对象在 Servlet 初始化阶段由 Web 容器实例化,并将当前 Servlet0 码力 | 330 页 | 6.54 MB | 2 年前3
Spring Framework 2.0.5 Changelogoverridden "toString()" implementation * FreeMarkerView exposes a ServletConfig object to FreeMarker, for use with ServletConfig-accessing JSP tags * fixed AbstractXsltView to correctly apply a specified ServletConfigAware interface, for getting access to a Framework/DispatcherServlet's ServletConfig object ServletConfig by default (can be turned off) * introduced Handler interface as alternative to Controller0 码力 | 56 页 | 157.72 KB | 2 年前3
Spring Framework 2.0.7 Changelogoverridden "toString()" implementation * FreeMarkerView exposes a ServletConfig object to FreeMarker, for use with ServletConfig-accessing JSP tags * fixed AbstractXsltView to correctly apply a specified access to a Framework/DispatcherServlet's ServletConfig object * SimpleServletPostProcessor configures Servlets with DispatcherServlet's ServletConfig by default (can be turned off) * introduced0 码力 | 60 页 | 172.65 KB | 2 年前3
Spring Framework 2.0.8 Changelogoverridden "toString()" implementation * FreeMarkerView exposes a ServletConfig object to FreeMarker, for use with ServletConfig-accessing JSP tags * fixed AbstractXsltView to correctly apply a specified access to a Framework/DispatcherServlet's ServletConfig object * SimpleServletPostProcessor configures Servlets with DispatcherServlet's ServletConfig by default (can be turned off) * introduced0 码力 | 62 页 | 177.54 KB | 2 年前3
Spring Framework 2.5.0 Changelogoverridden "toString()" implementation * FreeMarkerView exposes a ServletConfig object to FreeMarker, for use with ServletConfig-accessing JSP tags * fixed AbstractXsltView to correctly apply a specified access to a Framework/DispatcherServlet's ServletConfig object * SimpleServletPostProcessor configures Servlets with DispatcherServlet's ServletConfig by default (can be turned off) $ ^{*} $0 码力 | 78 页 | 221.83 KB | 2 年前3
Spring Framework 2.5.1 Changelogoverridden "toString()" implementation * FreeMarkerView exposes a ServletConfig object to FreeMarker, for use with ServletConfig-accessing JSP tags * fixed AbstractXsltView to correctly apply a specified access to a Framework/DispatcherServer's ServletConfig object * SimpleServletPostProcessor configures Servlets with DispatcherServlet's ServletConfig by default (can be turned off) * introduced0 码力 | 84 页 | 239.53 KB | 2 年前3
Spring Framework 2.5.3 Changelogoverridden "toString()" implementation * FreeMarkerView exposes a ServletConfig object to FreeMarker, for use with ServletConfig-accessing JSP tags * fixed AbstractXsltView to correctly apply a specified access to a Framework/DispatcherServlet's ServletConfig object * SimpleServletPostProcessor configures Servlets with DispatcherServlet's ServletConfig by default (can be turned off)0 码力 | 95 页 | 274.89 KB | 2 年前3
Spring Framework 2.5.2 Changelogoverridden "toString()" implementation * FreeMarkerView exposes a ServletConfig object to FreeMarker, for use with ServletConfig-accessing JSP tags * fixed AbstractXsltView to correctly apply a specified access to a Framework/DispatcherServlet's ServletConfig object * SimpleServletPostProcessor configures Servlet with DispatcherServlet's ServletConfig by default (can be turned off) * introduced0 码力 | 91 页 | 260.30 KB | 2 年前3
Spring Framework 2.5.4 Changelog"toString()" implementation * FreeMarkerView exposes a ServletConfig object to FreeMarker, for use with ServletConfig-accessing JSP tags * fixed AbstractXsltView to correctly apply a specified access to a Framework/DispatcherServlet's ServletConfig object * SimpleServletPostProcessor configures Servlets with DispatcherServlet's ServletConfig by default (can be turned off) * introduced0 码力 | 97 页 | 278.81 KB | 2 年前3
共 219 条
- 1
- 2
- 3
- 4
- 5
- 6
- 22
相关搜索词
ServletContextWeb 配置ServletConfigWeb 环境对象会话超时Java 应用与开发Java SEJava EE开发环境配置面向对象编程Spring FrameworkBeanFactoryAOP AllianceBeanWrapperTransactionTemplateAOPTransactionViewResolverXsltViewInterceptorWeb ModuleChangelogPackage UpdatesBug FixesNew FeaturesWeb MVCTransaction ManagementApplicationContextJdbcTemplatechangesorg.springframework.aoporg.springframework.contextorg.springframework.coreAspectJ事务管理JDBC













