📄 page.jsp
字号:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title>Jakarta PAGE Taglib Example</title>
</head>
<body bgcolor="white">
<center>
<h1>Jakarta PAGE Taglib Example</h1>
</center>
<br>
<%@ taglib uri="http://jakarta.apache.org/taglibs/page-1.0" prefix="page" %>
<p>
<pre>
Set an attribute named "myatt"
<page:setAttribute name="myatt">AAbb</page:setAttribute>
See if myatt attribute exists
<page:existsAttribute name="myatt">
myatt=<page:attribute name="myatt"/>
</page:existsAttribute>
<page:existsAttribute name="myatt" value="false">
Attribute myatt does not exist.
</page:existsAttribute>
See if myatt equals "aabb"
<page:equalsAttribute name="myatt" match="aabb">
myatt=<page:attribute name="myatt"/>
</page:equalsAttribute>
<page:equalsAttribute name="myatt" match="aabb" value="false">
Attribute myatt does not equal "aabb".
</page:equalsAttribute>
See if myatt equals "aabb", ignoring case
<page:equalsAttribute name="myatt" match="aabb" ignoreCase="true">
myatt=<page:attribute name="myatt"/>
</page:equalsAttribute>
<page:equalsAttribute name="myatt" match="aabb" value="false" ignoreCase="true">
Attribute myatt does not equal "aabb", ignoring case.
</page:equalsAttribute>
Now loop through all the attributes
<page:attributes id="att">
<jsp:getProperty name="att" property="name"/> = <jsp:getProperty name="att" property="value"/>
</page:attributes>
Now remove the attribute myatt
<page:removeAttribute name="myatt"/>
See if myatt attribute exists
<page:existsAttribute name="myatt">
myatt=<page:attribute name="myatt"/>
</page:existsAttribute>
<page:existsAttribute name="myatt" value="false">
Attribute myatt does not exist.
</page:existsAttribute>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -