• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

Display information with servlet

I am creating a basic servlet to test some concepts and would like show the referrer and the current browser that it is being displayed on.  -- I am teaching myself java and servlet technology with this, so even if there is a simpler way of getting this information without a servlet, I would like to see how to do it with the servlet.  

So far I have done a simple -- hello world, today is xxx -- page and that is about it...  I am using tomcat as a server if that makes any difference.
0
VoodooFrog
Asked:
VoodooFrog
  • 2
  • 2
1 Solution
 
KuldeepchaturvediCommented:
basically you can take your hello world servlet and usem your HttpRequest object to find out whatever you need to..
http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/http/HttpServletRequest.html
this has all the methods listed...
for the referrer and Browser you can use getHeader("referer"); and
getHeader("USER-AGENT"); for browser type..
0
 
VoodooFrogAuthor Commented:
thank you.
0
 
KuldeepchaturvediCommented:
Please accept the comment as solution if you think that it has answered your question.
Thanks
0
 
VoodooFrogAuthor Commented:
sorry -- slow on that.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now