?? logicdemo01.jsp
字號:
<%@ page language="java" pageEncoding="GBK"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<html:html lang="true">
<head>
<title>LogicDemo01.jsp</title>
</head>
<body>
<%
request.setAttribute("name","MLDN") ;
session.setAttribute("password","LXH") ;
// 通過標簽判斷在指定范圍中是否有屬性存在
%>
<loigc:present name="name" scope="request">
<h1>指定的屬性存在,內容為:${name}</h1>
<loigc:present>
<logic:notPresent name="name" scope="request">
<h1>指定的屬性不存在</h1>
</logic:notPresent>
<loigc:present name="password" scope="session">
<h1>指定的屬性存在,內容為:${password}</h1>
<loigc:present>
<logic:notPresent name="password" scope="session">
<h1>指定的屬性不存在</h1>
</logic:notPresent>
</body>
</html:html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -