Display information with servlet

Posted on 2007-10-01
Last Modified: 2013-11-24
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.
Question by:VoodooFrog
    LVL 19

    Accepted Solution

    basically you can take your hello world servlet and usem your HttpRequest object to find out whatever you need to..
    this has all the methods listed...
    for the referrer and Browser you can use getHeader("referer"); and
    getHeader("USER-AGENT"); for browser type..

    Author Comment

    thank you.
    LVL 19

    Expert Comment

    Please accept the comment as solution if you think that it has answered your question.

    Author Comment

    sorry -- slow on that.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    squareUp  challenge 22 83
    How Complex Is This Java Course ? 9 52
    firstChar challenge 13 60
    HashMap Vs TreeMap 12 34
    This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
    Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
    Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now