jsp学习杂记

“Include”指令可以把你的内容分成更多可管理的元素,比如包括一个普通页面页眉或页脚的元素。包含的网页可以是一个固定的HTML 页面或更多的JSP内容:
<%@ include file="filename.jsp" %>
在本页面显示"filename.jsp"里的内容。

include用来在主JSP文件中调用本地的一个其他文件,通常是一些版权信息啦,脚本语言啦等其他任何你想在其他文件中重复使用的代码。在这个例子中就是调用了一个图片其实。

插入图片:
<img src="struts-power.gif" alt="Powered by Struts">
图片放在当前目录下!

session用法:

在session中存放数据用request.getParameter("username")获取username(文本框)中的数据,存放在名为theName的地方;

<%
String name = request.getParameter("username");
session.setAttribute("theName",name);
String eMail = request.getParameter("email");
session.setAttribute("Email",eMail);
String telNum = request.getParameter("telnum");
session.setAttribute("TelNum",telNum);
%>

读取session中的数据:

用session.getAttribute("theName")读取存放在theName中的数据!

<%=
session.getAttribute("theName")
%>

posted on 2005-08-10 09:39 扭转乾坤 阅读(281) 评论(0)  编辑  收藏 所属分类: JSP相关


只有注册用户登录后才能发表评论。


网站导航:
 
<2005年8月>
31123456
78910111213
14151617181920
21222324252627
28293031123
45678910

导航

统计

常用链接

留言簿(2)

随笔分类(31)

随笔档案(30)

文章分类(32)

文章档案(33)

相册

PHP小站-首页

搜索

积分与排名

最新评论

阅读排行榜

评论排行榜