JSTL includes a wide variety of tags that fit into discrete functional areas. To reflect this, as well as to give each area its own namespace, JSTL is exposed as multiple tag libraries. The URIs for the libraries are as follows:
In addition to declaring the tag libraries, tutorial examples access the JSTL API and implementation. In the Application Server, the JSTL TLDs and libraries are distributed in the archive <J2EE_HOME>/lib/appserv-jstl.jar. This library is automatically loaded into the classpath of all web applications running on the Application Server, so you don't need to add it to your web application.
sql查询语句可以写为:
<sql:query var="books" sql="select * from web_bookstore_books where bookId='203'"></sql:query>
带参数:
<sql:query var="books" dataSource="jdbc/BookDB"> select * from web_bookstore_books where bookId=? <sql:param value="${bid}"/> </sql:query>
还有:
<sql:query var="books" sql="select * from web_bookstore_books where bookId = ?"> <sql:param value="${bookId}"/> </sql:query>
数据库更新:
<sql:update var="books" sql="update web_bookstore_books set inventory = inventory - ? where bookId = ?"> <sql:param value="${item.quantity}"/> <sql:param value="${bookId}"/> </sql:update>
JSTL includes a wide variety of tags that fit into discrete functional areas. To reflect this, as well as to give each area its own namespace, JSTL is exposed as multiple tag libraries. The URIs f