Answer:
(1)request.setAttribute()'s value can get in the next page only,not like session can get in all page. (2)you can do like this:
response.sendRedirect("B.jsp?para=theValue")
(1)request.setAttribute()'s value can get in the next page only,not like session can get in all page. (2)you can do like this:
response.sendRedirect("B.jsp?para=theValue")
解决方案 »
- 用过birt请教个交叉表的问题
- 论坛显示主题forumdisplay.php?f=17这种在java里怎样实现?
- 数据库查询问题 两种方式不一样的结果
- 我对tomcat和Java,jdk的理解,请各位帮我指正
- 在jsp上如何画拓朴图?
- java实现视频预览 ,类似百度视频和个google视频搜索显示结果的图片一样
- 怎样使用jfreechart画多种类型的组合图,如折线图和柱图在一张图显示?(急!急!)
- 为什么我tomcat多站点配置好,只能执行一个站点.急急!!!!
- 用JSP CREATE了一个有状态EJB后,如何在其他JSP中使用呢??
- 我急呀!请问作类型转换问题???
- 我准备学jsp,请大家推荐几本适合初学者的好书?
- Servlet中JDBC连接数据库的问题
A.jsp:
<%@ page contentType="text/html; charset=EUC-JP" %>
<html>
<head>
<title>
Jsp1
</title>
</head>
<body>
<h1>
JBuilder Generated JSP
</h1>
<form action="aa.jsp"method="post">
<%
request.setAttribute("shibushi","dsfds");
%><input type="submit"value="dfds">
</form>
</body>
</html>
aa.jsp:
<%@ page contentType="text/html; charset=EUC-JP" %>
<html>
<head>
<title>
aa
</title>
</head>
<body>
<h1>
JBuilder Generated JSP
</h1>
<%String name=null;
if(request.getAttribute("shibushi")!=null)
name=request.getAttribute("shibushi").toString();
%>
<%=name%>
</body>
</html>
结果为:null呀!