JSTL配置与国际化操作全解析
1. Config类介绍
Config类位于javax.servlet.jsp.jstl.core包中,它定义了一系列静态方法,用于对不同作用域下的配置设置进行操作。以下是这些方法的详细介绍:
| 方法 | 描述 |
| — | — |
|Object find(PageContext pc, String name)| 按页面、请求、会话和应用程序的顺序,在所有四个作用域中搜索指定名称的作用域变量。找到后返回其值;若未找到,返回同名上下文初始化参数的值;若都未找到,则返回null。 |
|Object get(PageContext pc, String name, int scope)| 获取指定作用域下的配置设置。 |
|Object get(ServletRequest request, String name)| 从请求中获取配置设置。 |
|Object get(HttpSession session, String name)| 从会话中获取配置设置。 |
|Object get(ServletContext context, String name)| 从应用程序上下文中获取配置设置。 |
|void set(PageContext pc, String name, Object value, int scope)| 在指定作