jsp内置对象request使用方法2
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.Date"%>
<%@ 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> <%
int a =1;
int b =2;
request.setAttribute("ab", a);
request.setAttribute("b", b); %>
<jsp:forward page="top.jsp"/>
</body> </html>
<%@page import="java.text.SimpleDateFormat"%> <%@ 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>
<% System.out.println(request.getAttribute("ab"));
System.out.println(request.getAttribute("b")); String b = request.getAttribute("b").toString();
%>
<%=request.getAttribute("b")%>
<%=b %>
</body>
</html>


jsp内置对象request使用方法2的更多相关文章
- JavaWeb——JSP内置对象request,response,重定向与转发 学习总结
什么是JSP内置对象 九大内置对象 requestJSP内置对象 request对象常用方法 request练习 responseJSP内置对象 response练习 response与request ...
- JSP内置对象-request
JSP内置对象即无需声明就可以直接使用的对象实例,在实际的开发过程中,比较常用的JSP对象有request,response,session,out和application等,笔者在本文章中将简单介绍 ...
- JSP内置对象---request对象(用户登录页面(返回值和数组:gerParameter,getParameterValues))
创建两个jsp页面:reg.jsp 和 request.jsp reg.jsp: <%@ page language="java" import="java.uti ...
- JSP内置对象---request 对象
request.jsp: <%@ page language="java" import="java.util.*" contentType=" ...
- JSP内置对象——request对象
request对象request对象封装了由客户端生成的HTTP请求的所有细节,主要包括HTTP头信息.系统信息.请求方式和请求参数等. 通过request对象提供的各种方法可以处理客户端浏览器提交的 ...
- JSP内置对象--request对象
本文主要介绍JSP中的request对象 request对象的主要方法: setAttribute(String name,Object):设置名字为name的request的参数值 getAttri ...
- jsp内置对象request 和response
1.request对象主要用于处理客户端的请求 request对象常用方法 一.String request.getParameter(String name) 根据页面表单 ...
- jsp内置对象request的使用方法
<%@page import="java.text.SimpleDateFormat"%> <%@page import="java.util.Date ...
- JSP内置对象--request对象 (setCharacterEncoding("GBK"),getParameter(),getParameterValues(),getParameterNames(),getServletPath(),getContextPath()
使用最多,主要用来接收客户端发送而来的请求信息,他是javax.servlet.http.HttpServletRequest接口的实例化对象. public interface HttpServle ...
随机推荐
- BEC listen and translation exercise 49
Astronaut Sounds Alarm on Asteroids If a big asteroid with Earth's name on it were to reach us unimp ...
- codeforces 553B B. Kyoya and Permutation(找规律)
题目链接: B. Kyoya and Permutation time limit per test 2 seconds memory limit per test 256 megabytes inp ...
- STL stl_config.h
stl_config.h . // Filename: stl_config.h . . // Comment By: 凝霜 . // E-mail: mdl2009@vip.qq.com . // ...
- 图的Tarjan算法
“Tarjan有三种算法 你们知道吗”——Tar乙己 void tarjan(int x) { low[x]=dfn[x]=++ind; q[++top]=x;mark[x]=; for(int i= ...
- luogu1801 黑匣子
惊了呀 Splay Treap 这都什么玩意 两个优先队列搞定 #include <bits/stdc++.h> using namespace std; #define LL long ...
- 2017-2018-1 20179203 《Linux内核原理与分析》第七周作业及第三周测试总结
攥写人:李鹏举 学号:20179203 ( 原创作品转载请注明出处) ( 学习课程:<Linux内核分析>MOOC课程http://mooc.study.163.com/course/US ...
- POJ1379:Run Away
我对模拟退火的理解:https://www.cnblogs.com/AKMer/p/9580982.html 我对爬山的理解:https://www.cnblogs.com/AKMer/p/95552 ...
- Android TextView跑马灯
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content&q ...
- Log4Net日志记录介绍
原文地址 : http://www.cnblogs.com/wolf-sun/p/3347373.html#3009010 简介 log4net库是Apache log4j框架在Microsoft . ...
- Jetson TX2火力全开
Jetson Tegra系统的应用涵盖越来越广,相应用户对性能和功耗的要求也呈现多样化.为此NVIDIA提供一种新的命令行工具,可以方便地让用户配置CPU状态,以最大限度地提高不同场景下的性能和能耗. ...