JSP的application对象
来源:互联网 发布:经传软件三板斧 编辑:程序博客网 时间:2024/05/22 15:38
一 简介
二 常用方法
三 实例
<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.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>
<h1>application内置对象</h1>
<%
application.setAttribute("city", "北京");
application.setAttribute("postcode", "10000");
application.setAttribute("email", "lisi@126.com");
%>
所在城市是:<%=application.getAttribute("city") %><br>
application中的属性有:<%
Enumeration attributes = application.getAttributeNames();
while(attributes.hasMoreElements())
{
out.println(attributes.nextElement()+" ");
}
%><br>
JSP(SERVLET)引擎名及版本号:<%=application.getServerInfo() %><br>
</body>
</html>
四 运行结果
阅读全文
0 0
- jsp的application对象
- JSP的application对象
- JSP的application对象
- JSP的内置对象application
- JSP application对象的使用
- JSP的9个内置对象-application
- JSP的内置对象(application)
- JSP之application对象
- Jsp中的application对象
- JSP内置对象----application
- application jsp内置对象
- JSP内置对象---application
- JSP内置对象---application
- jsp内置对象application
- JSP中的Application对象
- JSP之application对象
- JSP application对象
- JSP application对象
- JSP的page对象
- Android通知栏微技巧,通知栏按钮变得不那么敏感
- Linux分析操作系统磁盘容量
- 学习笔记(一):如何选择合适的算法
- [前端]input框 type="radio"显示不出
- JSP的application对象
- CNN卷积神经网络
- 利用shell监控mysql
- 带有侧滑菜单的+ 通过retrofit获取数据,通过fresco框架加载图片,使用TabLayout + ViewPage + Fragment + ListView 显示数据
- nginx应用状态分析
- shell日志分析概述
- Codeforces 600E Lomsat gelral (DSU on Tree)
- ORM初探
- Hibernate初探