jQuery in Action, 2nd edition
The moose likes Tomcat and the fly likes Printing the Url's in a jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Reply Bookmark "Printing the Url Watch "Printing the Url New topic
Author

Printing the Url's in a jsp

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 8795

Hi Guys,

Is there a way to print the url hitting Tomcat. Are there any configuraton changes that I can set up in Tomcat so that I can do this??
[ March 25, 2007: Message edited by: Jothi Shankar Kumar Sankararaj ]

SCJP 1.4, SCWCD 1.4 - Hints for you, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Print them to where; the user's browser, a log file on the server?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 8795

Print them to the Tomcat console!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35439
    
    9
If you are talking of the local URL that is being accessed, then that is being logged on the access log in the TOMCAT_HOME/logs file.

If you are talking of the REFERER header, then you could write a filter that is mapped to all requests which reads that from the request and logs it to System.out. That would also work for logging the local URL.


Android appsImageJ pluginsJava web charts
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

In tomcat/conf/server.xml there is an entry for a access-logging valve.
It is commented out by default.
If you uncomment it, it will log all access to tomcat in the standard logging format, recognized by Webalizer and the other popular log analyzing tools.

Depending on how you've installed and started Tomcat, stdout will either go to one of the log files under tomcat/logs or to the console.
There are free programs out there that will allow you to watch any log, in real time, just like the console.

In Unix the "tail -f" command will do this.
I've seen various free "tail" programs for windows.
Textpad also allows you to do this.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Printing the Url's in a jsp
 
Similar Threads
Tomcat and Netbeans
Integrate Tomcat in Weblogic
tomcat j2ee
where can i download tomcat from ???
tomcat download??