<%@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. 关于CMainFrm不接收鼠标事件响应原因

    CMainFrm即主框架窗口对鼠标的左键和右键在OnLButtonDown中无响应 解决方案: 1.在OnNcLButtonDown中响应.(即非客户区中响应) 参考文献:http://www.cod ...

  2. rust ownership 系统

    ### 对象销毁规则 未被使用的函数返回值 被let绑定的值, 在函数末尾销毁,除非被moved ``` let v = obj::new("a"); other_fun(v); ...

  3. hdu-5650 so easy(水题)

    题目链接: so easy Time Limit: 2000/1000 MS (Java/Others)   Memory Limit: 65536/65536 K (Java/Others)Tota ...

  4. 20179203 《Linux内核原理与分析》第十周作业

    第17章 设备与模块 一.设备类型 1. Linux及Unix系统: 块设备 字符设备 网络设备 2.块设备: 通常缩写为blkdev,它是可寻址的,寻址以块为单位,块大小随设备不同而不同:块设备通常 ...

  5. 2017-2018-1 20179203 《Linux内核原理与分析》第五周作业

    攥写人:李鹏举 学号:20179203 ( 原创作品转载请注明出处) ( 学习课程:<Linux内核分析>MOOC课程http://mooc.study.163.com/course/US ...

  6. YARN指令

    如果是使用了Cloudera来安装到此路径下: /opt/cloudera/parcels/CDH-5.10.2-1.cdh5.10.2.p0.5/bin 执行: sudo ./yarn applic ...

  7. python中string和bool的转换

    python中字符串"True" 和 "False"转为bool类型时, 不能通过bool(xx)强转. 注意是因为在python中,除了&apos;& ...

  8. 杂项-权限管理:Spring Secutity

    ylbtech-杂项-权限管理:Spring Secutity Spring Security是一个能够为基于Spring的企业应用系统提供声明式的安全访问控制解决方案的安全框架.它提供了一组可以在S ...

  9. Linker Tools Error LNK2001

    https://msdn.microsoft.com/en-us/library/f6xx1b1z.aspx https://www.cnblogs.com/runningRain/p/5674833 ...

  10. Hibernate---Hql查询2---

    hibernate.cfg.xml配置: <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE hibernate-configurati ...