java和jsp中的request使用示例
//== java request 详细说明==
system.out.println("rotocol: " + request.getprotocol());
system.out.println("scheme: " + request.getscheme());
system.out.println("server name: " + request.getservername() );
system.out.println("server port: " + request.getserverport());
system.out.println("rotocol: " + request.getprotocol());
system.out.println("server info: " + getservletconfig().getservletcontext().getserverinfo());
system.out.println("remote addr: " + request.getremoteaddr());
system.out.println("remote host: " + request.getremotehost());
system.out.println("character encoding: " + request.getcharacterencoding());
system.out.println("content length: " + request.getcontentlength());
system.out.println("content type: "+ request.getcontenttype());
system.out.println("auth type: " + request.getauthtype());
system.out.println("http method: " + request.getmethod());
system.out.println("ath info: " + request.getpathinfo());
system.out.println("ath trans: " + request.getpathtranslated());
system.out.println("query string: " + request.getquerystring());
system.out.println("remote user: " + request.getremoteuser());
system.out.println("session id: " + request.getrequestedsessionid());
system.out.println("request uri: " + request.getrequesturi());
system.out.println("servlet path: " + request.getservletpath());
system.out.println("accept: " + request.getheader("accept"));
system.out.println("host: " + request.getheader("host"));
system.out.println("referer : " + request.getheader("referer"));
system.out.println("accept-language : " + request.getheader("accept-language"));
system.out.println("accept-encoding : " + request.getheader("accept-encoding"));
system.out.println("user-agent : " + request.getheader("user-agent"));
system.out.println("connection : " + request.getheader("connection"));
system.out.println("cookie : " + request.getheader("cookie"));
system.out.println("created : " + session.getcreationtime());
system.out.println("lastaccessed : " + session.getlastaccessedtime());
// ==jsp request 详细说明==
out.println("protocol: " + request.getprotocol());
out.println("scheme: " + request.getscheme());
out.println("server name: " + request.getservername() );
out.println("server port: " + request.getserverport());
out.println("protocol: " + request.getprotocol());
out.println("server info: " + getservletconfig().getservletcontext().getserverinfo());
out.println("remote addr: " + request.getremoteaddr());
out.println("remote host: " + request.getremotehost());
out.println("character encoding: " + request.getcharacterencoding());
out.println("content length: " + request.getcontentlength());
out.println("content type: "+ request.getcontenttype());
out.println("auth type: " + request.getauthtype());
out.println("http method: " + request.getmethod());
out.println("path info: " + request.getpathinfo());
out.println("path trans: " + request.getpathtranslated());
out.println("query string: " + request.getquerystring());
out.println("remote user: " + request.getremoteuser());
out.println("session id: " + request.getrequestedsessionid());
out.println("request uri: " + request.getrequesturi());
out.println("servlet path: " + request.getservletpath());
out.println("accept: " + request.getheader("accept"));
out.println("host: " + request.getheader("host"));
out.println("referer : " + request.getheader("referer"));
out.println("accept-language : " + request.getheader("accept-language"));
out.println("accept-encoding : " + request.getheader("accept-encoding"));
out.println("user-agent : " + request.getheader("user-agent"));
out.println("connection : " + request.getheader("connection"));
out.println("cookie : " + request.getheader("cookie"));
out.println("created : " + session.getcreationtime());
out.println("lastaccessed : " + session.getlastaccessedtime());
推荐阅读
-
java和jsp中的request使用示例
-
Java中的HashSet详解和使用示例_动力节点Java学院整理
-
Java中LinkedList详解和使用示例_动力节点Java学院整理
-
java 中String和StringBuffer与StringBuilder的区别及使用方法
-
java JSP开发之Spring中Bean的使用
-
Java中四种线程池的使用示例详解
-
java web学习_浅谈request对象中get和post的差异
-
JSP内置对象:Request和Response的简单介绍及使用
-
Java8中stream和functional interface的配合使用详解
-
jsp中定义和使用方法示例介绍