
?

iii.常用请求头的说明
????????Accept:表示客户端可以接收的数据类型 ????????Accpet-Languege:表示客户端可以接收的语言类型User-Agent:表示客户端浏览器的信息 ????????Host:表示请求时的服务器ip和端口号l
GET请求有哪些:
1、form标签method=get? ? ?2、a标签 3、link标签引入css? ? ?4、Script标签引入s文件?
5、img 标签引入图片? ? 6、iframe引入 html 页面 7、在浏览器地址栏中输入地址后敲回车
post请求有哪些: ????????8,form标签method=post
d)常用的响应码说明
200 表示请求成功
302 表示请求重定向(明天讲>
404 表示请求服务器已经收到了,但是你要的数据不存在(请求地址错误〉
500 表示服务器已经收到请求,但是服务器内部错误(代码错误)
?

1.HttpServletRequest类 a)HttpServletRequest类有什么作用。 每次只要有请求进入Tomcat服务器,Tomcat服务器就会把请求过来的HTTP协议信息解析好封装到Request对象中。然后传递到 service方法(doGet和doPost)中给我们使用。我们可以通过 HttpServletRequest对象,获取到所有请求的信息。 ?

服务器端提交的数据,在servlet里面的doget里面获得参数。

对应网页部分的代码是这样的。
?



?setAttribute() 设置域对象
request.setAttribute(“users”,users)这个方法是将users这个对象保存在 request作用域中,然后在转发进入的页面就可以获取到你的值,如果你会一些框架的,那些框架标签也可以获取到,比如struts标签,还有jstl。

我的html必须部署在web目录下面,在web_info目录下面是不可以的啊。
/表示在web目录下面。?
base的作用:



?
也就是说我通过这个response对象就能够实现和浏览器进行信息的交互啊。
比如说后面的getWriter? 得到字符流。然后向浏览器输入信息。


?
重定向?

两个步骤:设置响用状态码,设置响用头?

?
一行代码实现重定向:

javaee三层架构

?
|