- 浏览: 170569 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
小桔子:
u 棒棒哒!按照你的搞定了,之前搞了好久!u 棒棒哒!!! ...
Ubuntu为Tomcat启用80端口 -
u011938035:
我用的是nutch1.7,org.apache.nutch.n ...
nutch1.4 URLNormalizers 详解 -
peigang:
试试跟踪一下脚本,应该是环境变量的问题。
nutch1.4:爬虫定时抓取设置 -
zhangmj10:
你好,看这帖子是好久以前的,不知道你能不能看到。不知道能不能帮 ...
nutch1.4:爬虫定时抓取设置 -
shinide1989:
楼主你好,我正需要修改html的解析,并想把结果存为其他格 ...
nutch1.4插件开发
JSTL 1.2.x is the latest version of JSTL. There are a few differences between this version and the previous JSTL 1.1.x version. The most important difference is that JSTL 1.2.x supports Unified EL (Expression Language) , where as JSTL 1.1.x supports only traditional EL. With Unified EL it becomes very easy to combine the EL in JSF (Java Server Faces) and the EL in JSTL. This guide shows you how to install JSTL 1.2.x properly or troubleshoot your existing JSTL installation.
-
Download JSTL 1.2.x
Get JSTL 1.2 from java.net Maven Repository for JSTL -
Install JSTL 1.2.x
Move the jstl-1.2.jar file to your project's WEB-INF/lib folder. -
Configure JSTL 1.2.x
This version of JSTL does not require any further configuration. See compatibility and depedency for more information. -
JSTL 1.2.x Compatibility
In short JSTL 1.2 is compatible with Unified EL, JSF 1.2, JSP 2.1, Servlet 2.5.
JSTL 1.2.x requires a Web Server (Container) that complies with the Servlet 2.5 / JSP 2.1 (or higher) specification.
For example: Tomcat 6.x complies with Servlet 2.5 and JSP 2.1 specifications.
See: Tomcat Version - Servlet Spec - JSP Spec chart
This also means that the deployment descriptor (web.xml file under your project's WEB-INF) folder must also comply with the Servlet 2.5 specification. This means that the web-app declartion and all the tags inside web.xml must be according to the Servlet 2.5 specification.<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> </web-app>
-
JSTL 1.2.x Dependency
JSTL 1.2.x comes with various tags that serve different purposes. Depending on which tags you plan to use you will need certain dependencies.
You don't need any other dependencies if you plan to use just the core, format, function tags or just Unified EL (expression language).
If you plan to use the sql tags then you'll need the JDBC connector JAR file for your database. You can place this connector JAR in your web container's lib folder.
If you plan to use the xml tags then you dependent JAR files Xalan.jar, Serializer.jar.
If you plan to use JSF along with JSTL 1.2.x then you need JSF version 1.2 which is compatible with JSP 2.1
If I've missed any other dependencies, then you'll get an exception error message such as "ClassNotFound", "Method Not Found" etc, examine the exception, to find out which package the class or method belongs to and then search for the distributions containing those class or method files. Get the distribution version that is compatible with the JSTL version you are using.
standard.jar is already included in jstl-1.2.jar, if you still have the standard.jar in WEB-INF/lib from and older installation of JSTL then you can remove it because it is already part of JSTL 1.2 JAR fil.e
Dependencies for previous version (JSTL 1.1.2) is here.
-
JSTL 1.2 Usage Guide
The tag library you plan to use must be defined in each JSP page the tags appear on. If you are familiar with XML terminology this is known as name space declartion. By declaring a namespace prefix of say "c"and associating it with a taglib URI, you are basically indicating that all tags that start with c: are JSTL core tags.
The taglib URIs are different across different versions of JSTL. Make sure that the taglib URIs you use in the JSP files match with the JSTL version you are using. The JSTL 1.2 taglib URIs are the same as JSTL 1.1.x taglib URIs.
To see JSTL 1.1.x the taglib URIs, click on the tag library of your choice. For example see the core taglib URI.
JSTL core:<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
JSTL fmt:<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
JSTL sql:<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
JSTL XML:<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
JSTL Functions:<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
JSTL 1.2 uses Unified EL, this means the EL in the JSTL,JSP are compatible with JSF EL.
JSTL core tags
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <html> <head><title>JSTL 1.2 core tag example</title></head> <body> <c:set var="mysStringVariable" value="Hello World!"/> <c:out var="myStringVariable"/> </body> </html>
JSTL 1.2 EL
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head><title>JSTL 1.2 EL example</title></head> <body> ${requestScope.myStringVariable} ${ 100/5 } ${ 9 <42 } </body> </html> Notice that no taglib definitions are required if only EL is written in a JSP page.
JSTL 1.2 Function tags
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <html> <head><title>JSTL 1.2 function tags </title></head> <body> ${fn:toUpperCase(requestScope.myStringVariable)} ${ fn:escapeXml(sessionScope.siteUrl) } </body> </html>
JSTL format ( fmt ) tags
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <html> <head><title>JSTL 1.2 format tag example</title></head> <body> <fmt:formatDate value="${dateVariable}" pattern="yyyy/MM/dd"/> </body> </html>
Sometimes the format tag doesn't work as expected. Especially date formatting doesn't work. This is because the format tag requires the locale to be set. For example:
<fmt:setLocale value="en-US"/>
See the API doc for setting the locale to the languageCode-CountryCode of your choice.
XML Tags Example - usage with external XML and XSTL files.
File: mydata.xml <?xml version="1.0" encoding="UTF-8"?> <books> <book> <title>JSTL 1.2 Reference</title> <author>Rashmi</author> </book> </books> File: transform_data.xsl <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="book"> <ul> <li> <xsl:value-of select="title" /> </li> <xsl:apply-templates select="book" /> </ul> </xsl:template> </xsl:stylesheet> File: index.jsp <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %> <html> <head><title>JSTL 1.2 XML Tags usage example</title></head> <body> <c:import url="mydata.xml" var="xml"/> <c:import url="transform_data.xsl" var="xsl"/> <x:transform doc="${xml}" xslt="${xsl}"/> Verify that the path (absolute, relative, context relative) of the above imported files is correct. Use forward slash / as a path separator. </body> </html>
XML Tag examples, with transformation within the JSP page (no external XSLT stylesheet).
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %> <c:import url="/data.xml" var="xmlData"/> <x:parse xml="${xmlData}" var="parsedDoc" /> <html> <head><title>JSTL 1.2 XML Transform Example</title></head> <body> <x:forEach select="$parsedDoc/books/book"> <x:out select="title"/> <br/> <x:out select="author"/> </x:forEach> </body> </html>
SQL tags example
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <!-- Define this JNDI, JDBC data source in context.xml or ROOT.xml --> <sql:setDataSource dataSource="jdbc/MyDB"/> <sql:query var="bookTitles"> SELECT title FROM book; </sql:query> <ul> <c:forEach var="title" items="${bookTitles.rows}"> <li> <c:out value="${fn:toLowerCase(title)}" escapeXml="true"/> </li> </c:forEach> </ul>Important Note: There are differences in configuration and JSTL URIs across different versions of JSTL. For example the taglib URIs for JSTL 1.0 is different from that of JSTL 1.1.x and 1.2, also the compatibility with the web server version, web.xml version, dependency configuration is different across versions. It is a good idea to check your version of JSTL and make sure everything is configured correctly for your version. If JSTL is configured incorrectly for its version, then these examples won't work. See configuration guides for JSTL 1.1.x and JSTL 1.2 for more details.
Unified EL is not evaluating
If the Unified EL does not evaluate this is most likely a compatibility issue. If you are upgrading from a previous version of JSTL it is recommended that you start fresh on a clean slate. Verify that the Web Container and your deployment descriptor (web.xml) is compatible with Servlet Specification 2.5 or higher. See compatibility for more details.
发表评论
-
CentOS7下Kafka的安装介绍
2018-11-18 17:53 373简介 Kafka 是一种高吞吐的分布式发布订阅消息系统, ... -
Ubuntu为Tomcat启用80端口
2012-09-11 15:05 10113一、tomcat部署调试 Update the pac ... -
MyEclipse配置IvyDE
2012-03-28 14:16 2221从以下地址下载eclipse,http://www.eclip ... -
Ubuntu 安装jdk
2012-02-19 18:58 907方法一:安装开源jdk 先运行执行java 或者javac测 ... -
nutch二次开发环境搭建
2011-05-03 17:05 1477本文在总结使用nutch1.2框架做二次开发实验中总结出开发环 ... -
NutchBean构造方法解析
2011-05-02 16:47 1178NutchBean(Configuration conf, P ... -
页面浮动窗口效果实现
2011-03-23 10:44 1726<style type="text/cs ... -
Lucene+Nutch搜索引擎开发一:介绍
2011-02-22 18:34 1053本系列文章是Lucene+Nutch学习、实现的记录,适用于有 ... -
Spring应用开发:控制反转实现(IOC)原理
2010-12-05 22:03 1055IOC的核心接口是BeanFactory,它的职责包括实例化、 ... -
Apache Axis2实现WebService在J2EE中的应用
2010-12-05 22:00 694整理中。。。。 -
Struts2应用开发详解--17、对国际化的支持。
2010-09-22 22:57 909国际化的支持建立在系统语言环境参数基础上,Struts框架会根 ... -
Struts2应用开发详解--16、对Action中的方法进行校验
2010-09-22 22:52 1013struts2的校验可以用两种方式实现: 一、java代码实 ... -
Struts2应用开发详解--15、自定义拦截器
2010-09-22 22:51 1195拦截器在实际开发中经常用到,典型的应用如对全局环境的权 ... -
Struts2应用开发详解--14、文件上传和下载
2010-09-22 22:51 780一、文件上传 Struts2的文件上传需要common ... -
Struts2应用开发详解--13、访问或者添加属性
2010-09-22 22:49 757Struts2中摒弃掉了Struts1中对servlet各种对 ... -
Struts2应用开发详解--12、自定义类型转换器
2010-09-22 22:48 752struts2中 1、局部类型转换器 2、全局 ... -
Struts2应用开发详解--11、请求参数的接收
2010-09-22 02:02 1088Struts2中请求参数以action属性的方式被初始化赋值。 ... -
Struts2应用开发详解--10、动态方法调用和使用通配符定义
2010-09-22 01:42 938Struts2的action默认调用方法为execute()。 ... -
Struts2应用开发详解--9、指定多个配置文件
2010-09-22 00:49 827复杂的系统开发会有很多的action配置。为便于管理开发中应该 ... -
Struts2应用开发详解--8、Struts2处理流程
2010-09-22 00:36 9131、解析web.xml中的过滤器org.apache.s ...
相关推荐
jstl-1.2.jar下载jstl-1.2.jar下载jstl-1.2.jar下载jstl-1.2.jar下载jstl-1.2.jar下载jstl-1.2.jar下载jstl-1.2.jar下载jstl-1.2.jar下载jstl-1.2.jar下载jstl-1.2.jar下载jstl-1.2.jar下载jstl-1.2.jar下载jstl-1.2...
**JSTL 1.2**: 这是JSTL的一个版本,提供了多种标签,包括用于控制流程的 `<c:if>`、循环的 `<c:forEach>`,以及处理表达式的 `<c:set>`等。JSTL 1.2包含了对JSP 2.0规范的支持,并且与EL(Expression Language)很...
java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config,以上错误可以使用以下策略试试,tomcat的lib文件夹下加入:jstl-1.2.jar、jstl-api-1.2.jar、jstl-impl-1.2.jar三个包。
包含了两个版本jstl文件,standard.jar和jstl-api-1.2.jar是一个版本,导入时需要将两个都导入,jstl-1.2.jar是高版本的,是将低版本的两个文件合成一个了,故只需要导入一个文件即可,导入的同时在jsp文件首行写入 ...
在给定的压缩包中,有两个关键文件:`jstl-api-1.2.jar` 和 `jstl-impl-1.2.jar`。它们分别是JSTL的API接口和实现的jar包。 **jstl-api-1.2.jar** 包含了JSTL的接口定义,定义了各种标签的API,比如`<c:forEach>`、...
`jstl-1.2.jar` 是JSTL 1.2版本的库文件,这个版本是在2004年发布的,增加了对JSR 152的支持,提供了对EL(Expression Language)的增强。 JSTL的核心组件包括以下几个部分: 1. **fmt**: 提供了日期、时间、数字的...
**JSTL 1.2.jar包详解** JavaServer Pages Standard Tag Library (JSTL) 是一个用于简化JavaWeb开发的库,它提供了一系列预定义的标签,使得开发者可以使用更简洁、更易于理解的方式编写JSP页面,而无需过多地接触...
"jstl-impl-1.2.jar"和"jstl-api-1.2.jar"是JSTL 1.2版本的两个关键组件,它们在Java Web应用中起着至关重要的作用。 1. **jstl-api-1.2.jar**: 这个jar文件包含了JSTL的API接口定义。它定义了所有JSTL标签库的接口...
《JSTL1.2深度解析与应用》 JSTL,全称为JavaServer Pages Standard Tag Library,是Java服务器页面标准标签库,是用于简化JavaWeb应用程序开发的一种强大的工具。在给定的“jstl1.2.zip”压缩包中,包含了四个核心...
《深入理解JSTL:基于jstl-1.2.jar的实践指南》 JSTL,全称为JavaServer Pages Standard Tag Library,是Java服务器页面标准标签库,它为JSP开发提供了一系列预定义的标签,使得开发者可以更加便捷地进行页面逻辑...
jstl-api-1.2、jstl-impl-1.2.jar标签包,两份。
在提供的文件中,`jstl-api-1.2.jar` 和 `jstl-impl-1.2.jar` 是JSTL 1.2版本的两个关键组件: 1. **jstl-api-1.2.jar**:这个文件包含了JSTL的API接口定义。它定义了所有JSTL标签的接口和类,是开发者在编写JSP...
`jstl-1.2.jar`是JSTL 1.2版本的核心库,包含了JSTL Core和JSTL Functions这两个模块。JSTL Core提供了处理基本操作的标签,如迭代、条件判断、URL操作等。例如,`<c:forEach>`用于遍历集合,`<c:if>`和`<c:choose>`...
4. **jstl-1.2.jar**:JSTL(JavaServer Pages Standard Tag Library)是一组预定义的标签库,用于简化JSP页面的开发。JSTL 1.2版本包括了核心标签、JDBC标签、XML标签和国际化的支持。这些标签可以用来处理常见任务...
**JSTL 1.2 全面解析** JavaServer Pages Standard Tag Library(JSTL)是用于增强JavaWeb应用程序的标签库,它提供了一系列预定义的标签,可以帮助开发者更简洁、更高效地编写JSP页面,从而降低对脚本语言的依赖。...
Tomcat启动报错 java.lang.ClassNotFoundException: org.apache.jsp.index_jsp,检查你的项目中是否存在jsp-api.jar,jstl-api.jar,servlet-api.jar。
jstl1.2.jar.与jstl1.0的区别 例如 1.0<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%> 1.2<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
**JSTL(JavaServer Pages Standard Tag Library)API 1.2详解** JSTL,全称为JavaServer Pages Standard Tag Library,是Java EE平台中一个用于简化JSP开发的库,它提供了一系列预定义的标签,帮助开发者在JSP页面...
标签中的"_jstl-impl-1.2.jar_ jstl-impl-1.2 jstl-impl-1.2.jar jstl.impl jstl.jar"进一步强调了JSTL的实现版本1.2,"impl"通常表示这是实现层,而非API接口。"jstl.jar"可能是指JSTL的核心库,不包含具体实现,而...