config
来源:互联网 发布:linux获取cpu使用率 编辑:程序博客网 时间:2024/05/16 04:58
config表示一个javax.servlet.ServletConfig对象
config对象是在一个Servlet初始化时,JSP引擎向它传递信息用的,此信息包括Servlet初始化时所要用到的参数(通过属性名和属性值构成)以及服务器的有关信息(通过传递一个ServletContext对象)。
web.xml配置:
<servlet>
<servlet-name>fileServlet</servlet-name>
<jsp-file>/config/config.jsp</jsp-file>
<init-param>
<param-name>filePath</param-name>
<param-value>c:/test</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>fileServlet</servlet-name>
<url-pattern>/file</url-pattern>
</servlet-mapping>
<%=config.getInitParameter(“filePath") %>
通过路径
http://ip:端口/上下文路径/file
访问config/config.jsp即可输出配置的参数
config对象是在一个Servlet初始化时,JSP引擎向它传递信息用的,此信息包括Servlet初始化时所要用到的参数(通过属性名和属性值构成)以及服务器的有关信息(通过传递一个ServletContext对象)。
web.xml配置:
<servlet>
<servlet-name>fileServlet</servlet-name>
<jsp-file>/config/config.jsp</jsp-file>
<init-param>
<param-name>filePath</param-name>
<param-value>c:/test</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>fileServlet</servlet-name>
<url-pattern>/file</url-pattern>
</servlet-mapping>
<%=config.getInitParameter(“filePath") %>
通过路径
http://ip:端口/上下文路径/file
访问config/config.jsp即可输出配置的参数
阅读全文
0 0
- Config
- .config
- config
- Config
- config
- config
- config
- config
- Config
- Config
- config
- config
- config
- config
- web.config
- Windows2000 Config
- About Config
- Config VIM
- 史上最全!阿里智能人机交互的核心技术解析
- 2017全球人工智能人才白皮书:解读世界顶级AI牛人的秘密!
- 【Scikit-Learn 中文文档】无监督降维
- RemoteViewsService.RemoteViewsFactory
- 发布mvc遇到的HTTP错误 403.14-Forbidden解决办法
- config
- Fragment的demo
- excepton
- 将编译后的class文件打成jar包
- es官网api
- 【早读Live】迅雷前端敏捷开发之路
- springboot实战之注册filter和listener
- 【第1130期】JavaScript 的时间消耗
- jsp_include和@include的区别