在多个jsp页面传递参数
1. 怎么在多个JSP页面之间进行参数传递?需要使用JSP的内置作用域对象session。利用它的两个方法setAttribute(),getAttribute()
2. 下面的这个实例实现了把第一个JSP页面的参数传递给第三个页面的功能
3. 代码如下:1.jsp
[img][/img]
<html>
<form method=get action=2.jsp>
what's your name<input type=text name=username>
<input type=submit value=submit>
</form>
</html>
4. 2.jsp
<html>
<form method=post action="3.jsp?pass=11">
<%
String name=request.getParameter("username");
session.setAttribute("username",name);
%>
Your name is:<%=request.getParameter("username")%>
<br>what's your hobby<input type=text name=hobby>
<input type=submit value=submit>
</form>
</html>
5. 3.jsp
<html>
your name is:<%=session.getAttribute("username")%>
<br>
your hobby is:<%=request.getParameter("hobby")%>
<br>
your password is:<%=request.getParameter("pass")%>
 
相关文档:
Fckeditor在jsp中的配置与使用
一、下载Fckeditor_2.6.3.zip与Fckeditor_2.3.zip,下载页面:www.fckeditor.net ,下载Fckeditor_2.3.zip:在download页面,浏览至Fckeditor.Java,点 击"Click here to download the latest version"进入下载页面,展开2.3目录. 下载后分别解压这两个压缩包。
二、在WebRoot文件夹下新建文件夹FC ......
我们都知道在jsp中include有两种形式,分别是
< %@ include file=” ”%>
< jsp:include page=” ” flush=”true”/>
前者是指令元素、后者是行为元素。具体它们将在何处用?如何用及它们有什么区别?这应该是很多人看到它都会想到的问题。下面一起来看看吧 ......
JFreeChart是一组功能强大、灵活易用的Java绘图API,使用它可以生成多种通用性的报表,包括柱状图、饼图、曲线图、甘特图等。它能够用在Swing和Web等中制作自定义的图表或报表,并且得到广泛的应用。本文将通过引领读者学习在JFreeChart中饼图、柱状图 ......
写Cookie:
//从浏览器取得用户名
String username = request.getParameter("username");
//从浏览器取得密码
String password = request.getParameter(" ......
(一)包含其他页面的方法:
include指令:<%@ include file = "test1.jsp" %>
静态包含,可以包含任意格式的文件(不光是jsp文件,还可以是txt等文本文件),静态包含就是将被包含文件的内容拷贝到包含文件中,进行执行。当前页面和test1.jsp中不能有重名的变量。
include动作 <jsp:include page = "tes ......