This week's giveaway is in the Java in General forum.
We're giving away four copies of Java Challengers and have Rafael del Nero on-line!
See this thread for details.
Win a copy of Java Challengers this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

how can get to know who

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

?
 
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43024
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic