Learning JSTL

博客介绍了JSTL包含支持迭代、条件判断和表达式语言的核心标签,还支持用于字符串操作的EL函数。其功能涵盖迭代、条件判断、表达式语言、文本包含、国际化文本格式化、XML操作、数据库访问等方面。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 JSTL includes core tags to support iteration, conditionals, and expression-language support. It also supports EL functions for string manipulation.

 

Iteration

The core iteration tag is , which iterates over most collections and similar objects you'd think to iterate over. lets you iterate over tokens in a String object; it lets you specify the String and the delimiters.

Conditionals

JSTL supports a simple conditional tag along with a collection of tags -- , , and -- that support mutually exclusive conditionals. These latter three tags let you implement a typical if/else if/else if/else structure.

Expression language

JSTL provides a few tags to facilitate use of the expression language. prints out the value of a particular expression in the current EL, similar to the way that the scriptlet expression (<%= ... %>) syntax prints out the value of a expression in the scripting language (typically Java). lets you set a scoped attribute (e.g., a value in the request, page, session, or application scopes) with the value of an expression.

Text inclusion

JSP supports the jsp:include tag, but this standard action is limited in that it only supports relative URLs. JSTL introduces the c:import tag, which lets you retrieve absolute URLs. For instance, you can use c:import to retrieve information from the web using HTTP URLs, or from a file server using an FTP URL. The tag also has some advanced support for performance optimizations, avoiding unnecessary buffering of data that's retrieved.

I18N-capable text formatting

Formatting data is one of the key tasks in many JSP pages. JSTL introduces tags to support data formatting and parsing. These tags rely on convenient machinery to support internationalized applications.

XML manipulation

You can't look anywhere these days without seeing XML, and JSTL gives you convenient support for manipulating it from your JSP pages. Parse documents, use XPath to select content, and perform XSLT transformations from within your JSP pages.

Database access

Easily access relational databases using the SQL actions. You can perform database queries, easily access results, perform updates, and group several operations into a transaction.

Functions

String manipulations can be performed using the functions provided in JSTL.

From: jakarta.apache.org

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值