JSP的内置对象分析.pptx

  1. 1、本文档共80页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
动态网页设计;第4章 JSP内置对象;内置对象功能举例说明;JSP中的9种内置对象;4.2 与输入/输出有关的内置对象;4.2.1 request对象;4.2.1 request对象(续);1.取得请求参数的方法 ;2.取得请求HTTP 头的方法 ;3.储存和取得属性方法 ;4.其他的方法 ;4.其他的方法(续) ;request比较重要的方法 ;. 获得客户端提交的信息;获得客户端提交的信息(续);. 处理中文信息;JSP页面的汉字问题主要指两方面: JSP页面中的汉字问题 表单提交的汉字问题;(1)JSP页面的汉字问题;(2)表单提交的汉字问题;(2)表单提交的汉字问题(续);. 类型转换问题;请输入一个数字,计算其平方根: FORM action=exa3_2.jsp method=post name=form INPUT type=text name=“tnumber INPUT TYPE=submit value=Enter name=submit /FORM ;%String textContent=request.getParameter(“tnumber); double number=0,r=0; if(textContent==null) {textContent=100; } try{ number=Double.parseDouble(textContent); if(number=0) {r=Math.sqrt(number) ; out.print(BR+String.valueOf(number)+的平方根:); out.print(BR+String.valueOf(r)); } else {out.print(BR+请输入一个正数); } } catch(NumberFormatException e) {out.print(BR+请输入数字字符); } % /FONT /BODY/HTML;. 避免空指针异常;. 其它常用方法;%@page contentType=text/html;charset=GB2312% html body h2 align=center Request对象获得服务器端参数 /h1 font size=3 color=blue request.getMethod(): %= request.getMethod() % br request.getProtocol(): %= request.getProtocol() % br request.getServletPath(): %= request.getServletPath() % br request.getServerName(): %= request.getServerName() % br request.getServerPort(): %= request.getServerPort() % br request.getRemoteUser(): %= request.getRemoteUser() % br request.getRemoteAddr(): %= request.getRemoteAddr() % br request.getRemoteHost(): %= request.getRemoteHost() % br hr 正在使用的浏览器:%= request.getHeader(User-Agent) % hr /font /body /html;. 获取HTML表单中的各种数据;p诗人李清照是中国历史上哪个朝代的人? form action=answer.jsp method=post name=form input type=radio name=“t1 value=a checked=aa宋朝 input type=radio name= t1 value=b唐朝 input type=radio name= t1 value=c明朝 input type=radio name= t1 val

文档评论(0)

191****0059 + 关注
官方认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:5342242001000034
认证主体四川龙斌文化科技有限公司
IP属地四川
统一社会信用代码/组织机构代码
91510100MA6ADW1H0N

1亿VIP精品文档

相关文档