JSP Source Code
 
  Click on the links below to view the source code of your choice. Learn how to set up a JSP Engine and web server on your machine and all about writing and executing JSP programs in The Beginner's Guide to Web Development.


Get HTTP Referrer This JSP code retrieves the HTTP Referrer from the HTTP header information contained within the HttpServletRequest (request) object. This code will work even if jumping from HTTPS to HTTP connections.
 
Get Browser Version This JSP code gets the browser version of the user making the HTTP request by getting the user-agent from the HTTP header information contained in the HttpServletRequest (request) object.
 
Show CGI Values This JSP code shows how to display some common cgi values using the HttpServletRequest (request) object.
 
Write to a File This JSP code shows how to write to a file from inside a JSP page using some of the Writer classes in the java.io package. These include BufferedWriter, FileWriter, and PrintWriter.