• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how can get to know who

 
bhagya patil
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In development environment we have tomcat services running
on our local machine.
How can we know if any one accsses my app from his browser in java?
like http://mymachine ort/my application from hi browser.

?
 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean accessing your app in browser in Java? Anyway, you can check the Tomcat access log for that. In order to enable the access log in Tomcat, edit the server.xml and uncomment this line
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All accesses to a Tomcat instance are logged in files called "localhost_access_log.2008-01-31.txt" or some such in the TOMCAT_HOME/logs directory.

This can be configured somewhat; search for "AccessLogValve" in the TOMCAT_HOME/conf/server.xml file.
 
Aneel Ansari
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Http headers are set by client are used to inform server about software the client is using and how the client would prefer a server send back requested information. From a servlet, HTTP request headers can be accessed by calling several methods. In your case as you just wanna know who is accessing you application, you can implement

request.getHearderNames();
request.getHeader(headerName);

Note: getHearderNames() method returns Enumeration

Hope this will help.
[ January 31, 2008: Message edited by: Aneel Ansari ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic