程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> JAVA編程 >> JAVA綜合教程 >> el表達式,el表達式判斷是否為空

el表達式,el表達式判斷是否為空

編輯:JAVA綜合教程

el表達式,el表達式判斷是否為空


<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="com.lzp.domain.*" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>My JSP 'el.jsp' starting page</title>
    
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->

  </head>
  
  <body>
    <c:out value="el表達式測試"></c:out>
    <%
    request.setAttribute("username", "requestusername");
    session.setAttribute("username", "sessionusername");
    pageContext.setAttribute("username", "pageContextusername");
    application.setAttribute("username", "applicationusername");
     %>
     <c:out value="全域查找結果"/>
     ${username }
     <br/>
     
     
     ${pageScope.username}<br/>
     ${applicationScope.username }<br/>
     ${sessionScope.username}<br/>
     ${requestScope.username}<br/>
     
     <h6>javaBean與el相結合的使用</h6>
     <%
     Person p =new Person();
     p.setAge(22);
     p.setName("王小明");
     request.setAttribute("p", p);
     
      %>
     ${p.age }${p.name }
     
     <h6>其他對象</h6>
     ${param.XXX }
     ${paramValues.YYY[0] }
     ${paramValues.YYY[1] }
     
     ${cookie.JSESSIONID.value}=${cookie.JSESSIONID.name}
     
     ${pageContext.request.contextPath }
     
     
     ${fn:length(paramValues)}
     ${fn:toLowerCase(param.XXX)}
     
  </body>
</html>

http://localhost:8090/jstl/el.jsp?XXX=AAA&YYY=yyy&YYY=yyy1

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved