zoukankan      html  css  js  c++  java
  • JSP application对象及其常用方法

    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>Insert title here</title>
    </head>
    <body>
    <h1>application内置对象</h1>
    <%
      application.setAttribute("postcode", "100000");
      application.setAttribute("city", "北京");
      application.setAttribute("email", "lisi@126.com");
    %>
    所在的城市是:<%=application.getAttribute("city") %><br>
    application中的属性有:<%
      Enumeration attributes = application.getAttributeNames();
      while(attributes.hasMoreElements()){
          out.println(attributes.nextElement()+"&nbsp;&nbsp;<br>");
      }
    %><br>
    JSP(SERVELET)引擎名及版本号:<%=application.getServerInfo() %>
    </body>
    </html>

    这里写图片描述

  • 相关阅读:
    web 移动端 适配
    meta
    meta设置
    时间
    CentOS下配置nginx conf/koi-win为同一文件的各类错误
    CentOS7 配置LAMP
    centos 进度条卡死
    LeetCode02:两数相加
    LeetCode01:两数之和
    单链表类,链表逆置
  • 原文地址:https://www.cnblogs.com/CCCrunner/p/11781710.html
Copyright © 2011-2022 走看看