Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Newb question. How to use only Servlet?

  1. #1
    Junior Member
    Join Date
    Mar 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Newb question. How to use only Servlet?

    Hi all, I'm a very experienced java programmer, but just now starting on java web development. I'm using eclipse with glassfish and I'm currently just trying to set up a Servlet hello world. I've gotten the project created and it added index.jsp automatically. I ran it and added some java in <% %> tags which executed just fine. I've now written a HelloWorldServlet class and overridden processRequest() to print hello world to the page. However, I can't figure out how to have the Servlet executed when the app's url is visited (instead of index.jsp).

    For example, currently http://localhost:8080/helloworld executes index.jsp
    I would like to modify the app to have my Servlet executed from that url instead.

    Any guidance here would be greatly appreciated


  2. #2
    Junior Member
    Join Date
    Mar 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Newb question. How to use only Servlet?

    Quote Originally Posted by rektiphyr View Post
    Hi all, I'm a very experienced java programmer, but just now staring on java web development. I'm using eclipse with glassfish and I'm currently just trying to set up a Servlet hello world. I've gotten the project created and it added index.jsp automatically. I ran it and added some java in <% %> tags which executed just fine. I've now written a HelloWorldServlet class and overridden processRequest() to print hello world to the page. However, I can't figure out how to have the Servlet executed when the app's url is visited (instead of index.jsp).

    For example, currently http://localhost:8080/helloworld executes index.jsp
    I would like to modify the app to have my Servlet executed from that url instead.

    Any guidance here would be greatly appreciated
    Ok... have I misunderstood something? Is this not possible? Is my question not clear?

Similar Threads

  1. Java Newb...forum newb also
    By ElTucan831 in forum Member Introductions
    Replies: 2
    Last Post: December 22nd, 2012, 06:08 PM
  2. Please help, newb with a simple question...
    By AtlDynasty25 in forum What's Wrong With My Code?
    Replies: 8
    Last Post: October 12th, 2011, 06:09 AM
  3. Newb question: Using the same object over two methods?
    By CitizenSmif in forum Object Oriented Programming
    Replies: 5
    Last Post: July 3rd, 2011, 08:17 PM
  4. Question About servlet and HTML
    By kurt-hardy in forum Java Theory & Questions
    Replies: 5
    Last Post: January 14th, 2011, 09:25 PM
  5. Servlet Threads Question
    By doNotPost in forum Threads
    Replies: 1
    Last Post: October 21st, 2010, 09:19 AM