- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
2012第三章JSP标记1
第三章 JSP标记 !– 文件eg311.jsp -- %@ page contentType =text/html; charset=GB2312 % html body p加载的文件: jsp:include page=sum.jsp / /body /html !– 文件sum.jsp -- %@ page contentType =text/html; charset=GB2312 % html body % int sum=0; for(int i=1;i=100;i++) { sum+=i; } % p从1到100的连续和为:%=sum% /body /html 案例4 %@ page language=java contentType=text/html;charset=gb2312% html head titlejsp:forward动作指令/title /head body 使用jsp:forward动作指令实现服务器端跳转。 jsp:forward page=Forwarded.jsp/jsp:forward /body /html 案例4 Forwarded.jsp %@ page language=java contentType=text/html;charset=gb2312% html head title跳转到的页面/title /head body 跳转到的页面 /body /html !– 文件exercise.htm -- html body 提交表单,如果为指定字符串则转到一个页面,否则转到另一页面提示:“你无权访问”。 hr form action=exercise2.jsp input type=text name=myname input type=submit /form /body /html !– 文件exercise2.jsp -- %@ page contentType=text/html;charset=GB2312% html body 根据表单提交的数据跳转 hr %if(request.getParameter(myname).equals(ok)){ % jsp:forward page=exercise4.jsp/ % } else { % jsp:forward page=exercise3.jsp/ %}% /body /html !– 文件exercise4.jsp -- %@ page contentType=text/html;charset=GB2312% html body h1OK! 登录成功 /h1 /body /html !– 文件exercise3.jsp -- %@ page contentType=text/html;charset=GB2312% html body h1对不起 你无权访问 /h1 /body /html !– 文件forward_3.jsp -- %@ page contentType=text/html;charset=GBK % % request.setCharacterEncoding(GBK); % html head titleforward动作的例子/title /head body bgcolor=blue jsp:forward page=forward_4.jsp jsp:param name=name value=张飞/ jsp:param name=roles value=employee/ /jsp:forward br test br test br /body /html !– 文件forward_4.jsp -- html body bgcolor=yellow br %=request.getParameter(name)% %=request.getParameter(roles)% /body /html 案例2:使用include指令实现页面导航功能 文件名称:include.jsp HTML HEAD TITLE New Document /TITLE /HEAD BODY %@include file=public.htm% br Testbr Testbr Testbr Testbr %@include file=public.htm% /BODY /HTML 案例3 文件名称:include1.jsp %@ pa
您可能关注的文档
- 2012年世界军事大国实力排行榜《30项》.ppt
- 2012年中考化学温习资料 第8讲 化学反应基础类型课件[资料].ppt
- 2012年中小学教师学科素养考核工作的说明.ppt
- 2012年中小学教师学科素养考核工作的说明【精品-ppt】.ppt
- 2012年中考政治温习《资料菏泽市思惟品行试题解读》PPT课件[资料].ppt
- 2012年佛山医用耗材及试剂集中采购操作指南.ppt
- 2012年厦门海关保税惯例查对操纵规程及保税查对实务商量[宝典].ppt
- 2012年中考化学温习资料(金属和金属资料)[资料].ppt
- 2012年中考物理温习资料(热和能)[资料].ppt
- 2012年全国产品速递 第3季(合院、洋房、叠拼专辑).ppt
- 2012考研心理统计与测量基础班讲义PPT课件.ppt
- 2012语文温习资料包08 修辞 春联1[资料].ppt
- 2012语文温习资料包04 修改病句1[资料].ppt
- 2012硕士学位论文格式及论文答辩要求.ppt.ppt
- 2012财务治理专业微不雅经济学期末温习(03版本)[整理版].ppt
- 2012自考企业管理咨询复习题(最新教材).ppt
- 2012诊断学绪论ppt[精华].ppt
- 2012要点:《情商与智慧人生》课程理论知识.ppt
- 2012高考一轮历史复习学海拾珍 必修1第3单元考点4+英国君主立宪制的确立与 (共30张PPT).ppt
- 2012高考一轮复习物理(要点+命题导向+策略)第10章交变电流传感器(共53张pt).ppt
原创力文档


文档评论(0)