[Java Web Study Note]Response,Request Collation

Long time to see.

Request & Reponse are like two paper of our medical record.

 

As everyone knows, Request page has two attributes,one is Parameter,the other is Attribute.

Parameter doesn't hava setter method only getter method.however Attribute has.

Just like our medical record,we record our base infomation such as name,age,sex on the Parameter area;Doctor record the ill case information on the attribute area.Our name,age,sex can't be changed by doctor.Doctor only has the right to record our ill case.

 
Request table
ParameterAttribute
keyvaluekeyvalue
namePeter_Xu

ill case 1

xxxxx
age24ill case 2xxxxx
sexgentle  

Doctor has right to getAttribute() our ill information and of course to setAttribute() our ill information and of course to getParameter() our base information but does not have right to setParameter() our base information.

 

Response looks more like the cover page of the medical record,or the command sent by the doctor.

Response page records where you from,where you go.

 

OK,Let's see sth else.

when we want to display sth Chinese infmation,we must use

request.setCharacterEncoding("utf-8");

before

request.getParameter("name");

but this situation is fit for post request.

 

dispatcher & undispatcher

dispatcher:

1 information alive.

2 address unchange.

3 no need to add the web application name

4 dispatcher in the application inner area.

5 one dispatcher.

undispatcher:

1 information lose

2 address change

3 may need application name

4 can redirect to other application

5 repeatedly request.

转载于:https://www.cnblogs.com/Xuhaiyang/archive/2012/07/01/2572012.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值