• EL表达式中隐式对象


    <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
    
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <title>el隐式对象</title>
      </head>
      
      <body>
        
        ${pageContext }  <!-- pageContext.findAttribute("name") -->
        
        
        <br/>
        
        <br/>---------------从指定的page域中查找数据------------------------<br/>
        <% 
            pageContext.setAttribute("name","aaa");  //map
        %>
        ${pageScope.name }
       
       
           <br/>---------------从request域中获取数据------------------------<br/>
           <% 
               request.setAttribute("name","bbb");  //map
           %>
           ${requestScope.name }
           
           <br/>---------------从session域中获取数据------------------------<br/>
           ${sessionScope.user }
           
           
           <br/>--------------获得用于保存请求参数map,并从map中获取数据------------------------<br/>
           <!-- http://localhost:8080/day12/3.jsp?name=aaa  -->
           ${param.name }  
           
           <!-- 此表达式会经常用在数据回显上 -->
           <form action="${pageContext.request.contextPath }/servlet/RegisterServlet" method="post">
               <input type="text" name="username" value="${param.username }">
               <input type="submit" value="注册">
           </form>
           
           <br/>--------------paramValues获得请求参数 //map{"",String[]}------------------------<br/>
           <!-- http://localhost:8080/day12/3.jsp?like=aaa&like=bbb -->
           ${paramValues.like[0] }  
           ${paramValues.like[1] } 
           
           <br/>--------------header获得请求头------------------------<br/>
           ${header.Accept } 
           ${header["Accept-Encoding"] }
           
           
           <br/>--------------获取客户机提交的cookie------------------------<br/>
           <!-- 从cookie隐式对象中根据名称获取到的是cookie对象,要想获取值,还需要.value -->
           ${cookie.JSESSIONID.value }  //保存所有cookie的map
           
           
           <br/>--------------获取web应用初始化参数------------------------<br/>
           ${initParam.xxx }  //servletContext中用于保存初始化参数的map
           ${initParam.root }
           
      </body>
    </html>
  • 相关阅读:
    python Database Poll for SQL SERVER
    SQLAlchemy表操作和增删改查
    flask动态url规则
    flask配置管理
    一个Flask运行分析
    Function Set in OPEN CASCADE
    Happy New Year 2016
    Apply Newton Method to Find Extrema in OPEN CASCADE
    OPEN CASCADE Multiple Variable Function
    OPEN CASCADE Gauss Least Square
  • 原文地址:https://www.cnblogs.com/lichone2010/p/3150096.html
Copyright © 2020-2023  润新知