internet log file using jsp

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eshcse
    New Member
    • Mar 2008
    • 1

    internet log file using jsp

    i need to make a log of all the websites visited thro my intenet explorer(sort of history like thing) but i need it in the following format
    "user_name<spac e>url_visited<s pace>time"

    the user_name is stored in a cookie by my webserver(J2EE web server) so i need some code to access this cookie info and also the url entered by the user and store it in some local file.

    Using some std proxy server wont help since i need to access my cookie info. Pls suggest me some ideas or techniques for doing this.
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    #2
    Could something like this help you going:

    Code:
    <html>
      <head>
              <title>Fetch Cookie</title>
      </head> 
      <body>
              <h3>Fetch and Read Cookie</h3> 
        <%
    ....initiate cookie instance
    
              Cookie[] cookies = request.getCookies();
    
    ....loop until criteria is met for this cookie being read
    
              for(int cookieIndex = 0; cookieIndex < cookies.length; cookieIndex++) { 
              if (cookies[cookieIndex].getName().equals("message")) {
    
    ....load the cookie found for all to see
    
              out.println("Cookie results: " + cookies[cookieIndex].getValue());
                 }
               } 
        %>
      </body> 
    </html>
    Try that!

    Dököll

    Comment

    Working...