jsp里的变量
来源:互联网 发布:org.json jar包 编辑:程序博客网 时间:2024/05/02 07:17
1、basePath
<% //假设我有个项目drp
String path = request.getContextPath(); //相当于访问项目路径中的/drp
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; //相当于http://localhost:8080/drp/
%>
<html>
<head>
<base href="<%=basePath %>"> //相当于项目中的所有路径的起始位置都是http://localhost:8080/drp/,即都是从根路径开始,此时所有相对路径都失去意义。
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>添加分销商</title>
<link rel="stylesheet" href="style/drp.css"> //此时的href相当于:http://localhost:8080/drp/style/drp.css
<script src="script/client_validate.js"></script> //此时的src相当于:http://localhost:8080/drp/script/client_validate.js
<script type="text/javascript">
2、request.getParameter
jsp里的java文件中可以通过request.getParameter("id")得到刚页面刚输入的文本内容
<% //假设我有个项目drp
String path = request.getContextPath(); //相当于访问项目路径中的/drp
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; //相当于http://localhost:8080/drp/
%>
<html>
<head>
<base href="<%=basePath %>"> //相当于项目中的所有路径的起始位置都是http://localhost:8080/drp/,即都是从根路径开始,此时所有相对路径都失去意义。
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>添加分销商</title>
<link rel="stylesheet" href="style/drp.css"> //此时的href相当于:http://localhost:8080/drp/style/drp.css
<script src="script/client_validate.js"></script> //此时的src相当于:http://localhost:8080/drp/script/client_validate.js
<script type="text/javascript">
2、request.getParameter
jsp里的java文件中可以通过request.getParameter("id")得到刚页面刚输入的文本内容
- jsp里的变量
- JSP里request变量列表
- JSP里request变量列表
- as里的变量
- JSP里的basePath
- JSP里的basePath
- JSP里的basePath
- JSP里的basePath
- JSP里的basePath
- JSP里的basePath
- jquery如何引用jsp变量实现获得的cookiepassword写入密码里
- JSP的变量
- jsp 变量的引用
- Salesforce里的trigger里的变量
- ??javascript里的变量问题
- matlab里的静态变量
- bash里的特殊变量
- Oracle里的绑定变量
- 母函数(Generating function)详解
- document.selection 和getSelection 的demo
- ActiveMQ之Ajax调用
- linux 消息队列实例
- 我的VC花指令方法,VC花指令,反跟踪技术
- jsp里的变量
- 在iOS上实现瀑布流界面
- HDU-1002
- <zz>machine learning中的重要延伸模型
- OpenCV简介
- gcc 简介
- 复制TreeView里的内容?
- ArcGIS field calculator 110个实例 —— Easy Calculate 5.0
- 消息队列实例(同一进程消息队列通信)