Servlet和JSTL在web.xml中的配置
2016-05-12 17:40
465 查看
<span style="font-family:Times New Roman;font-size:24px;">JSTL</span><span style="font-family:KaiTi_GB2312;font-size:24px;">配置如下:</span>
<pre name="code" class="java"><span style="font-family:Times New Roman;font-size:18px;"><jsp-config> <taglib> <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri> <taglib-location>/WEB-INF/c.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jsp/jstl/xml</taglib-uri> <taglib-location>/WEB-INF/x.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jsp/jstl/fmt</taglib-uri> <taglib-location>/WEB-INF/fmt.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jsp/jstl/sql</taglib-uri> <taglib-location>/WEB-INF/sql.tld</taglib-location> </taglib> </jsp-config></span>
Servlet配置如下:
<pre name="code" class="java"><span style="font-family:KaiTi_GB2312;font-size:24px;"> </span><span style="font-family:Times New Roman;font-size:18px;"><servlet> <servlet-name>ExitServlet</servlet-name> <servlet-class>com.servlet.ExitServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>LoginServlet</servlet-name> <url-pattern>/LoginServlet</url-pattern> </servlet-mapping></span>
<span style="font-family:Times New Roman;font-size:18px;"><servlet>用来配置</span><span style="font-family: 'Times New Roman'; font-size: 18px;"><servlet></span><span style="font-family: 'Times New Roman'; font-size: 18px;">对象名字,</span><span style="font-family: 'Times New Roman'; font-size: 18px;"><servlet-name>表示配置的名称,可以任意</span>
<span style="font-family: 'Times New Roman'; font-size: 18px;">设置,</span><span style="font-family: 'Times New Roman'; font-size: 18px;"> <servlet-class>为对象所有的类,要填写完整路径。</span><span style="font-family: 'Times New Roman'; font-size: 18px;"><servlet-mapping>用来</span>
<span style="font-family: 'Times New Roman'; font-size: 18px;">映射虚拟路径,</span><span style="font-family: 'Times New Roman'; font-size: 18px;"><url-pattern>是JSP所访问的路径,填写这个URL,即可进行访问。</span>
相关文章推荐
- 关于JSP配置文件web.xml加载顺序详解
- 关于jsp页面使用jstl的异常分析
- 在JSTL EL中处理java.util.Map,及嵌套List的情况
- 解决JSTL foEach标签 刷新报错的方法
- jsp web.xml文件的作用及基本配置
- JSP中一些JSTL核心标签用法总结
- jsp 使用jstl实现翻页实例代码
- jsp中使用jstl导入html乱码问题解决方法
- JSP入门教程之客户端验证、常用输出方式及JSTL基本用法
- 基于jstl 标签的使用介绍
- JSP中使用JSTL按不同条件输出内容的方法
- <Servlet>web.xml中load-on-startup的作用
- JSTL 数据向上/下取整
- 自定义JSP的 JSTL标签函数过程
- JAVA web.xml 加载顺序
- 使用JSTL报错:"items" does not support runtime expre...
- j2ee之web.xml (Servlet 3.0)配置讲解
- 用过滤器处理乱码问题 javaweb
- JSP中一些JSTL核心标签用法总结
- struts2.2.3 web.xml文件配置