站内搜索: 请输入搜索关键词

当前页面: 开发资料首页JSP 专题在jsp页面中如何取的http的状态码

在jsp页面中如何取的http的状态码

摘要: 在jsp页面中如何取的http的状态码


在jsp页面中如何取的http的状态码
就是http头中的状态码



request.getHeader()
public java.lang.String getHeader(java.lang.String name)Returns the value of the specified request header as a String. If the request did not include a header of the specified name, this method returns null. The header name is case insensitive. You can use this method with any request header. Parameters:name - a String specifying the header name Returns:a String containing the value of the requested header, or null if the request does not have a header of that name


request.getHeaders()
public java.util.Enumeration getHeaders(java.lang.String name)Returns all the values of the specified request header as an Enumeration of String objects. Some headers, such as Accept-Language can be sent by clients as several headers each with a different value rather than sending the header as a comma separated list. If the request did not include any headers of the specified name, this method returns an empty Enumeration. The header name is case insensitive. You can use this method with any request header. Parameters:name - a String specifying the header name Returns:an Enumeration containing the values of the requested header. If the request does not have any headers of that name return an empty enumeration. If the container does not allow access to header information, return null


request.getHeaderNames()
public java.util.Enumeration getHeaderNames()Returns an enumeration of all the header names this request contains. If the request has no headers, this method returns an empty enumeration. Some servlet containers do not allow do not allow servlets to access headers using this method, in which case this method returns null Returns:an enumeration of all the header names sent with this request; if the request has no headers, an empty enumeration; if the servlet container does not allow servlets to use this method, null


楼上的。。。疯了。。。


java.net.HttpURLConnection.getResponseCode()


楼上的这位老兄,能说的详细点吗,我的水平比较菜,java.net.HttpURLConnection.getResponseCode()编译不过去呀!java.net.HttpURLConnection中没有getResponseCode()这个方法呀,我是想在jsp中实现的,请高手指点


怎么没有人回答呢?


帮顶


不明白,你作什么用啊?


搞不懂


↑返回目录
前一篇: 有这样一个问题,求教
后一篇: 100分求struts+hibernate的例子。