码迷,mamicode.com
首页 > 其他好文 > 详细

el表达式

时间:2016-05-31 08:56:08      阅读:109      评论:0      收藏:0      [点我收藏+]

标签:

<%@ 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

el表达式

标签:

原文地址:http://www.cnblogs.com/lzhp/p/5544615.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!