文档介绍:CHANGJIUNIVERSITY2015-2016学年第二学期WEB超筹试针实儉報告专业:计算机科学与技术班级:B1203班学号:1225929029姓名:美日古卵■麦麦提敏提交日期:2016年3月29日实验题目实验4JSP内置对象实验实验目的及要求丨、掌握怎样在JSP中使用内置对象request。2、 掌握怎样使用session对象存储和用户有关的数据。3、 编写一个猜英文26个小写字母的Web游戏。实验过程要求:1、代码如下:Guessletter:<%***@tagpageEncoding=”GS2322"%><%***@attributename="guessLetter"required=’’true”%><%***@variablename-given="messageuscope=nAT_END"%><%Stringmess=,'H;Characterch=(character)(nsavedlettern);charrealletter=();charc=(()).charAt(0);if(c<=,z,&&c>=,a,){if(realletter==c){intn=((Integer)(Hcount")).intValue();n=n+l;("count,newInteger(n));mess="&猜对了,这是第"+[1+"次猜测}elseif(realletter<c){intn=((Integer)("count")).intValue();n=n+l;("countnewInteger(n));mess="您猜大了,这是第"+n+"次猜测";}elseif(realletter>c){intn=((Integer)("count")).intValue();n=n+l;("count",newInteger(n));mess=*t、猜小了,这是第1*+n+"次猜测";}}else{mess=n请输入a至z之间的英文字母";}("message"mess);"将对象message返回给]SP页面%>练****六:<%***@pagecontentType="text/htmL;charset=GB231211%><HTML>〈BODY2<%("massage",••请您猜字母");chara[]=newchar[26];intm=0;for(charc='a,;c<=,z,;c++){ a[m]=c;m++;}intrandomlndex=(int)(()*);charch=a[randomlndex];(Hsavedletter"newCharacter(ch));("countnewInteger(0));%><BR><A