Snoop in jsp
It mostly contains the request information, ServletContext initialization parameters, ServetContext attributes, request headers, response headers etc.
The code of the program is given below:
<%@ page import="javax.servlet.http.HttpUtils,java.util.*" %> <h1> Request Information </h1> <font size="4"> JSP Request Method: <%= request.getMethod() %> <br> Request URI: <%= request.getRequestURI() %> <br> Request Protocol: <%= request.getProtocol() %> <br> Servlet path: <%= request.getServletPath() %> <br> Path info: <%= request.getPathInfo() %> <br> Query string: <%= request.getQueryString() %> <br> Content length: <%= request.getContentLength() %> <br> Content type: <%= request.getContentType() %> <br> Server name: <%= request.getServerName() %> <br> Server port: <%= request.getServerPort() %> <br> Remote user: <%= request.getRemoteUser() %> <br> Remote address: <%= request.getRemoteAddr() %> <br> Remote host: <%= request.getRemoteHost() %> <br> Authorization scheme: <%= request.getAuthType() %> <br> Locale: <%= request.getLocale() %> <hr> The browser you are using is <%= request.getHeader("User-Agent") %> <hr> </font> </body> </html> |
The output of the program is given below: