zoukankan      html  css  js  c++  java
  • JSP内置对象-----application

    <%@page import="java.util.Enumeration"%>
    <%@ page language="java" contentType="text/html; charset=utf-8"
        pageEncoding="utf-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>JSP内置对象-application</title>
    </head>
    <body>
    <h1>application</h1>
    <hr>
    <%
        application.setAttribute("city", "北京");
        application.setAttribute("postcode", "100000");
        application.setAttribute("email", "beijing@163.com");
    %>
    
        所在城市是:<%=application.getAttribute("city") %><br>
        application中的属性有:<%
            Enumeration attibutes=application.getAttributeNames();
            
            while(attibutes.hasMoreElements()){
                out.println(attibutes.nextElement()+"&nbsp;&nbsp;");
            }
        
        %><br>
        JSP(servlet)引擎名及版本号:<%=application.getServerInfo() %>
    
    </body>
    </html>

  • 相关阅读:
    国际组织
    波段
    hhgis驱动
    百度地图格式
    气象数据格式
    汽车用传感器
    无线传感器网络
    【系统软件工程师面试】7. 消息队列
    【ToDo】存储设计概述
    Arthas: Java 动态追踪技术
  • 原文地址:https://www.cnblogs.com/1ming/p/9450413.html
Copyright © 2011-2022 走看看