作業(yè)6 3.24

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"

? ? pageEncoding="ISO-8859-1"%>

<!DOCTYPE html>

<html>

<head>

<meta charset="ISO-8859-1">

<title>Insert title here</title>

</head>

<body>

<h1>EL執(zhí)行運(yùn)算</h1>

<%

? pageContext.setAttribute("n1",10);

? pageContext.setAttribute("n2",20);

%>

${ n1 + n2 + n3 }

<h3>執(zhí)行算數(shù)運(yùn)算</h3>

${ n1 < n2 } -- ${ n1 lt n2 }<br>

${ n1 > n2 } -- ${ n1 gt n2 }<br>

${ n1 == n2 } -- ${ n1 eq n2 }<br>

${ n1 >= n2 } -- ${ n1 ge n2 }<br>

${ n1 <= n2 } -- ${ n1 le n2 }<br>

${ n1 != n2 } -- ${ n1 ne n2 }<br>

<h3>執(zhí)行邏輯運(yùn)算</h3>

<%

? pageContext.setAttribute("n3","30");

? pageContext.setAttribute("n4","40");

%>

${ (n1 < n2) && (n3 < n4) -- ${ (n1 < n2) and (n3 < n4) }<br>

${ (n1 < n2) || (n3 < n4) -- ${ (n1 < n2) or (n3 < n4) }<br>

${ !(n1 < n2) } -- ${ not (n1 < n2) }<br>

<h3>執(zhí)行三元算</h3>

${ n1 < n2 ? "n1小于n2" : "n1不小于n2" }

<h3>空運(yùn)算符</h3>

${ empty user }<br>

${ not empty user }<br>

</body>

</html>

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • <%@ page language="java" contentType="text/html; charset=...
    逝水清塵_66d5閱讀 149評(píng)論 0 0
  • JSP <%@ page language="java" contentType="text/html; char...
    卡拉什尼科夫_8ca2閱讀 288評(píng)論 0 0
  • 代碼 <%@ page language="java" contentType="text/html; chars...
    涼梔_6e9d閱讀 79評(píng)論 0 0
  • 一、JSP基礎(chǔ) 1.1什么是JSP JSP(Java ServerPage)是Java服務(wù)器端動(dòng)態(tài)頁(yè)面技術(shù)。是su...
    晨星資源閱讀 1,269評(píng)論 0 6
  • 【JSP的腳本】? <%! %> :翻譯成Servlet中的成員內(nèi)容. 定義變量,方法,類. -...
    chcvn閱讀 340評(píng)論 0 0

友情鏈接更多精彩內(nèi)容