Home Jsp Simple-jsp-example Snoop in jsp


Share on Google+Share on Google+

Snoop in jsp

It mostly contains the request information,

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() %>
Request URI: <%= request.getRequestURI() %>
Request Protocol: <%= request.getProtocol() %>
Servlet path: <%= request.getServletPath() %>
Path info: <%= request.getPathInfo() %>
Query string: <%= request.getQueryString() %>
Content length: <%= request.getContentLength() %>
Content type: <%= request.getContentType() %>
Server name: <%= request.getServerName() %>
Server port: <%= request.getServerPort() %>
Remote user: <%= request.getRemoteUser() %>
Remote address: <%= request.getRemoteAddr() %>
Remote host: <%= request.getRemoteHost() %>
Authorization scheme: <%= request.getAuthType() %> 
Locale: <%= request.getLocale() %>
The browser you are using is <%= request.getHeader("User-Agent") %>

The output of the program is given below:

Download this example.


If you enjoyed this post then why not add us on Google+? Add us to your Circles

Liked it!  Share this Tutorial

Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: February 8, 2008

Related Tutorials

Ask Questions?    Discuss: Snoop in jsp  

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image