<%@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的更多相关文章

  1. JavaWeb——JSP内置对象request,response,重定向与转发 学习总结

    什么是JSP内置对象 九大内置对象 requestJSP内置对象 request对象常用方法 request练习 responseJSP内置对象 response练习 response与request ...

  2. JSP内置对象-request

    JSP内置对象即无需声明就可以直接使用的对象实例,在实际的开发过程中,比较常用的JSP对象有request,response,session,out和application等,笔者在本文章中将简单介绍 ...

  3. JSP内置对象---request对象(用户登录页面(返回值和数组:gerParameter,getParameterValues))

    创建两个jsp页面:reg.jsp 和 request.jsp reg.jsp: <%@ page language="java" import="java.uti ...

  4. JSP内置对象---request 对象

    request.jsp: <%@ page language="java" import="java.util.*" contentType=" ...

  5. JSP内置对象——request对象

    request对象request对象封装了由客户端生成的HTTP请求的所有细节,主要包括HTTP头信息.系统信息.请求方式和请求参数等. 通过request对象提供的各种方法可以处理客户端浏览器提交的 ...

  6. JSP内置对象--request对象

    本文主要介绍JSP中的request对象 request对象的主要方法: setAttribute(String name,Object):设置名字为name的request的参数值 getAttri ...

  7. jsp内置对象request 和response

    1.request对象主要用于处理客户端的请求 request对象常用方法 一.String  request.getParameter(String name)             根据页面表单 ...

  8. jsp内置对象request的使用方法

    <%@page import="java.text.SimpleDateFormat"%> <%@page import="java.util.Date ...

  9. JSP内置对象--request对象 (setCharacterEncoding("GBK"),getParameter(),getParameterValues(),getParameterNames(),getServletPath(),getContextPath()

    使用最多,主要用来接收客户端发送而来的请求信息,他是javax.servlet.http.HttpServletRequest接口的实例化对象. public interface HttpServle ...

随机推荐

  1. hdu 3537 Daizhenyang's Coin(博弈-翻硬币游戏)

    题意:每次可以翻动一个.二个或三个硬币.(Mock Turtles游戏) 初始编号从0开始. 当N==1时,硬币为:正,先手必胜,所以sg[0]=1. 当N==2时,硬币为:反正,先手必赢,先手操作后 ...

  2. 【LeetCode】019. Remove Nth Node From End of List

    Given a linked list, remove the nth node from the end of list and return its head. For example, Give ...

  3. Operating System-Thread(4) 线程的调度激活机制(Scheduler Activations)

    本文主要介绍线程的调度激活机制(Scheduler Activations),主要内容: 调度激活机制简介 上行调用(upcall) 中断处理(Interrupt) 一. 调度激活机制简介 上一篇文章 ...

  4. Parallel Programming-Task Base

    Parallel.For/ForEach是数据层面的并行,本文所讲的Task是将不同的操作并行执行,本文主要内容: Task的工作模型 初始化Task 完成Task 取消Task 一.Task工作模型 ...

  5. UILabel常见用法

    //创建一个UILabel UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(50 , 100 , 200 , 560)]; // ...

  6. Windows Touch 便笺簿的

    Windows Touch 便笺簿的 C# 示例 (MTScratchpadWMTouchCS)   本节介绍 Windows Touch 便笺簿的 C# 示例. Windows Touch 便笺簿的 ...

  7. OpenStack、CloudStack、Eucalyptus和vCloud Director四大主流云平台怎么选?

    软件产品开发公司Altoros Systems的IT基础设施设计师Vadim Truksha在美国<网络世界>上发表一篇文章,详细对比了CloudStack.Eucalyptus.vClo ...

  8. javaScript之跨浏览器的事件对象

    跨浏览器的兼容代码 var eventHandler = { addHandler: function(element, type, handler){}, removeHandler: functi ...

  9. [HDU1003]最长子序列和

    http://acm.hdu.edu.cn/showproblem.php?pid=1003 解题关键:1.最大连续子序列和模板 2.max.end不能使用,在oj中会显示编译错误 3.注意模板中没有 ...

  10. mysql数据库int(5)以及varchar(20)长度表示的是什么?

    在mysql5.x版本的数据库中: int类型数据的字节大小是固定的4个字节: 但是int(5)和int(11)区别在于,显示的数据位数一个是5位一个是11位,在开启zerofill(填充零)情况下, ...