List of request variables in JSP

Source: Internet
Author: User
Tags auth session id variables query server port
js|request| variable <%
Out.println ("Protocol:" + request.getprotocol () + "<br>");
Out.println ("Scheme:" + request.getscheme () + "<br>");
Out.println ("Server Name:" + request.getservername () + "<br>");
Out.println ("Server Port:" + request.getserverport () + "<br>");
Out.println ("Protocol:" + request.getprotocol () + "<br>");
Out.println ("Server Info:" + getservletconfig (). Getservletcontext (). Getserverinfo () + "<br>");
Out.println ("Remote Addr:" + request.getremoteaddr () + "<br>");
Out.println ("Remote Host:" + request.getremotehost () + "<br>");
Out.println ("Character Encoding:" + request.getcharacterencoding () + "<br>");
Out.println ("Content Length:" + request.getcontentlength () + "<br>");
Out.println ("Content Type:" + request.getcontenttype () + "<br>");
Out.println ("Auth Type:" + request.getauthtype () + "<br>");
Out.println ("HTTP method:" + request.getmethod () + "<br>");
Out.println ("Path Info:" + request.getpathinfo () + "<br>");
Out.println ("Path Trans:" + request.getpathtranslated () + "<br>");
Out.println ("Query String:" + request.getquerystring () + "<br>");
Out.println ("Remote User:" + request.getremoteuser () + "<br>");
Out.println ("Session Id:" + request.getrequestedsessionid () + "<br>");
Out.println ("Request URI:" + request.getrequesturi () + "<br>");
Out.println ("Servlet Path:" + request.getservletpath () + "<br>");
Out.println ("Accept:" + request.getheader ("Accept") + "<br>");
Out.println ("Host:" + Request.getheader ("host") + "<br>");
Out.println ("Referer:" + request.getheader ("Referer") + "<br>");
Out.println ("Accept-language:" + request.getheader ("accept-language") + "<br>");
Out.println ("accept-encoding:" + request.getheader ("accept-encoding") + "<br>");
Out.println ("user-agent:" + request.getheader ("user-agent") + "<br>");
Out.println ("Connection:" + request.getheader ("Connection") + "<br>");
Out.println ("Cookie:" + request.getheader ("cookie") + "<br>");
Out.println ("Created:" + session.getcreationtime () + "<br>");
Out.println ("lastaccessed:" + session.getlastaccessedtime () + "<br>");


%>

Run Result:

protocol:http/1.1
Scheme:http
Server name:192.168.0.1
Server port:8080
protocol:http/1.1
Server info:javaserver Web Dev kit/1.0 EA (JSP 1.0; Servlet 2.1; Java 1.2; Windows NT 5.0 x86; Java.vendor=sun Microsystems Inc.)
Remote addr:192.168.0.106
Remote HOST:ABC
Character Encoding:null
Content Length:-1
Content Type:null
Auth Type:null
HTTP Method:get
Path Info:null
Path Trans:null
Query String:null
Remote User:null
Session Id:to1010mc466113890241879at
Request URI:/c.jsp
Servlet Path:/c.jsp
Accept: */*
host:192.168.0.1:8080
Referer:null
Accept-language:zh-cn
Accept-encoding:gzip, deflate
user-agent:mozilla/4.0 (compatible; MSIE 5.0; Windows 98; Digext)
Connection:keep-alive
Cookie:sessionid=to1010mc466113890241879at
created:965764522168
lastaccessed:965775587088

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.