jstl-api jstl
JSTL stands for JSP Standard Tag Library. JSTL is the standard tag library that provides tags to control the JSP page behavior. JSTL tags can be used for iteration and control statements, internationalization, SQL etc. We will look into JSTL Tags in detail in this JSTL tutorial.
JSTL代表JSP标准标记库 。 JSTL是标准的标记库,它提供用于控制JSP页面行为的标记。 JSTL标签可用于迭代和控制语句,国际化,SQL等。我们将在此JSTL教程中详细研究JSTL标签。
Earlier we saw how we can use JSP EL and JSP Action Tags to write JSP code like HTML but their functionality is very limited. For example, we can’t loop through a collection using EL or action elements and we can’t escape HTML tags to show them like text in client side. This is where JSTL tags comes handy because we can do much more from JSTL tags.
前面我们看到了如何使用JSP EL和JSP动作标签来编写HTML之类的JSP代码,但是它们的功能非常有限。 例如,我们不能使用EL或action元素遍历一个集合,也不能逃脱HTML标签以在客户端将其显示为文本。 这是JSTL标签派上用场的地方,因为我们可以从JSTL标签做更多的事情。
JSTL (JSTL)
JSTL is part of the Java EE API and included in most servlet containers. But to use JSTL in our JSP pages, we need to download the JSTL jars for your servlet container. Most of the times, you can find them in the example projects of server download and you can use them. You need to include these libraries in your web application project WEB-INF/lib directory.
JSTL是Java EE API的一部分,并包含在大多数Servlet容器中。 但是要在我们的JSP页面中使用JSTL,我们需要为您的servlet容器下载JSTL jar。 大多数时候,您可以在服务器下载的示例项目中找到它们,并可以使用它们。 您需要将这些库包含在Web应用程序项目WEB-INF / lib目录中。
JSTL罐子 (JSTL jars)
JSTL jars are container specific, for example in Tomcat, we need to include jstl.jar
and standard.jar
jar files in project build path. If they are not present in the container lib directory, you should include them into your application. If you have maven project, below dependencies should be added in pom.xml
file or else you will get following error in JSP pages – eclipse Can not find the tag library descriptor for "https://java.sun.com/jsp/jstl/ core"
JSTL jar是特定于容器的,例如在Tomcat中,我们需要在项目构建路径中包括jstl.jar
和standard.jar
jar文件。 如果它们在容器lib目录中不存在,则应将它们包含在应用程序中。 如果您有Maven项目,则应在pom.xml
文件中添加以下依赖项,否则您将在JSP页面中收到以下错误-eclipse eclipse Can not find the tag library descriptor for "https://java.sun.com/jsp/jstl/ core"
<dependency&