Cant see my First Servlet

HI
I am using tomcat 5.0.25. and my application server is running well with all my jsp pages. I have to use servlet very soon. So I am playing with simple Hello servlet. But after following all the steps(?), I am not able to view my servlet , instead I get 404 error. Obviously I am missing something. Here is how I do it:
I created a folder 'ts' inside $CATALINA-HOME/webapps/ROOT.
I created a folder WEB_INF inside ts.
Inside WEB_INF, I created 'web.xml' and 2 folders :'classes' &  'lib'
My 'lib' folder is now empty. I compile my HelloServlet class and place HelloServlet.class inside the folder 'classes'here is the content of web.xml file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
  <display-name>My First Servelt</display-name>
  <description>
     First Test servlet
  </description>
<!-- JSPC servlet mappings start -->
    <servlet>
        <servlet-name>HelloServlet</servlet-name>
        <servlet-class>HelloServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>HelloServlet</servlet-name>
        <url-pattern>/HelloServlet</url-pattern>
    </servlet-mapping>
<!-- JSPC servlet mappings end -->
</web-app>Here is how I invoke my HelloServlet:
http://127.0.0.1:8080/testservlet/HelloServlet
But unable to see my servlet. Somewhere , I heard something about 'adding context to server.xml' . But dont know why and how. Does my problem has to do with this? Any help will be appreciated.
TIA
tiptip

Well here I am with my result: Try to follow the exact procedure again and again but unsuccess ul. There is a folder called servlets-examples that comes with tomcat and I can successfully invoke those servlet from browser.
Here what I did so far:
I created a folder 'example' inside $CATALINA_HOME/webapps
Inside that  I created  a web.xml file and two folders: classes & lib
Inside classes I created a folder called 'pack1'
Inside pack1, I place my HelloWorldExample.classHere is my HelloWorldExample.java
package pack1;
import java.io.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
* The simplest possible servlet.
* @author James Duncan Davidson
public class HelloWorldExample extends HttpServlet {
  public void doGet(HttpServletRequest request,HttpServletResponse response)
                      throws IOException, ServletException    {
       String title = "HELLO WORLD";
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        out.println("<html>");
        out.println("<head>");       
        out.println("<title>" + title + "</title>");
        out.println("</head>");
        out.println("<body bgcolor=\"white\">");
        out.println("<h1>" + title + "</h1>");
        out.println("</body>");
        out.println("</html>");
}here is web.xml file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
    <display-name>Servlet 2.4 Examples</display-name>
    <description>
      Servlet 2.4 Examples.
    </description>
    <!-- Define servlets that are included in the example application -->
    <servlet>
        <servlet-name>HelloWorldExample</servlet-name>
        <servlet-class>pack1.HelloWorldExample</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>HelloWorldExample</servlet-name>
        <url-pattern>/HelloWorldExample</url-pattern>
    </servlet-mapping>
   </web-app>Here is how I invoke my servlet:
http://127.0.0.1:8080/example/HelloWorldExample
Yet no clue about how I can see my own servlet. Thanks

Similar Messages

  • Cant see my full view in edit window

    Hi im new to mac and logic 9. In my edit window where you record your music, I cant see the full veiw of the edit window. I mean, at the top where you have the numbers on the ruler that makes up bars, I cant see the first bar. My view on the ruler in the edit window starts at 2 and goes on. How can I set it where I can see the full view of the ruler starting at number one? Thanks I hope at said this right.

    Click and drag the Start marker point to the left
    [Setting Project Properties|http://documentation.apple.com/en/logicpro/usermanual/index.html#cha pter=7%26section=8] look on How to define a project's Start Point
    A

  • Setting up the I Pad for the first time I am stuck on the wi fi page it can see the network my pc cant see the i pad

    setting up the i pad for the first time i am stuck on the wi fi page it can see the network but my pc cant see it

    Since you have a modem/router, you must continue to use the Beetel modem/router on your network.
    The Time Capsule can connect to the Beetel modem/router using a wired Ethernet cable connection and produce a separate wireless network.  You would NOT want the Beetel router and Time Capsule to both try to produce the same wireless network if they are located close together, since this will likely create interference problems that may prevent devices from connecting to either the Beetel orTime Capsule wireless network.
    The exception to having the Beetel modem/router and Time Capsule produce the same wireless network would be if you can locate the Time Capsule at least a room or two away from the Beetel modem/router.  An Ethernet cable can be run up to 300+ feet or about 100 meters with no signal loss, so you should be able to locate the Time Capsule anywhere you want.
    Are you able to consider this option?
    Another option.....if you cannot locate the Time Capsule in another room......would be to configure the Time Capsule to use the same wireless network name and password as the Beetel network and turn off the wireless on Bettel modem/router.
    Important.....there is no guarantee that the printer will be able to connect to the Time Capsule wireless network, so you should expect to start over and set up the printer again.
    Yet another option would be to turn off the wireless service on the Time Capsule and use the Beetel wireless to back up your computers to the Time Capsule, which will act as a wired hard drive for the network. If you select this option, the Time Capsule can be located close to the Beetel modem/router.

  • I loved ny iPad at first now im starting to hate it, because flashplayer doen't work there are so many pages i cant open and tings i cant see.why are Apple so difficult? Why not open for flashplayer??!!!!

    WHy not open fore flashplayer. I'm starting to hate my iPad because og it, ther are so many tings i cant see and do on internett because flashplayer cant be installed on ipad.i hate it!!!

    IT's up to them to redo their pages to be more compliant with the rest of the internet. Flash, as a program, is like a VCR. Still usable, still functional, but its days are numbered....may be numbered in the thousands, but its a program that people literally block and disallow from their computers. As far as some are concerned, it's legal malware.
    I personally love the fact that I can avoid all those '2 meg take over your browser and screen' ads with my iPad. It is frustrating to find polls and the such that don't function, but that's when I just pull out hte laptop and use that. And on any given day I run my laptop with flash deliberately turned off and blocked...and its's amazing how fast the internet is without all the massive ads.
    There are some browsers in the app store that work with some flash sites (there's none that are universally compatible....part of the problem with Flash as a program, it doesn't even work consistently from comptuer to computer)
    Skyfire and Photon are two names I've seen recommended. You can give them a try and see if they work for you.

  • I purchased a mac book air today. When in store I was able to see all of my music in itunes. Now I am at home I cant see any of my music although i tunes is authorized on the computer. How do I fix this ?

    I purchased a mac book air today. When in store I was able to see all of my music in itunes. Now I am at home I cant see any of my music although i tunes is authorized on the computer. How do I fix this ?

    The warranty entitles you to complimentary phone support for the first 90 days of ownership.

  • BBM version 6.1.0.49 - my bbm contacts cant see my Dp when i change it (Bold 9900 )

    Hello,
    I just bought my blackberry a few days go and I can’t see the display image of BBM contacts and they also cant see mine.
     The only time I could see their display image is when they change it.
     I tried changing my and they still can’t see it.
     I have tried the following
    1.       Updated OS to version 7.0.0 bundle 2406
    2.       Updated BBM to v6.1.0.49
    3.       Registered by BBM via the HRT
    Go to Options
    Select the Advance Options
    Select Host Routing Table
    Choose the “BOLD” point
    Press your BB menu
    Select Register Now
    Then it would be showing some message, “Your Handheld registered with the wireless network..”
    Restart your BlackBerry devices.
     4.       Rebooted & Restarted after each update
    5.       Removed the battery and restarted
    6.  Used Desktop manager to delete and reinstall BBM
    7. Downgraded BBM version from 6.1.0.49 to 6.0.032 to 6.0.0.25
    8. Downgraded OS system from Version 7 latest to the version 7 before it
    9. Deleted and reinstalled app world
    10. in fact i have done everything i can possibly think of and still have the same problem and result
    At first I thought this would be ok after adding several BBM contacts, but I have added up to 10 contacts today and still cant see their display image and they too cant see mine.
     I would really appreciate assistance on this.
     Kind regards
    Olu
     BB PIN: 28E6846A
    Location: United Kingdom
    Network provider: Orange

    i also have the same problem with my bold 9900, my contacts can't see my display picture. anyone with an idea of what to do? help desperately needed.
    tal.

  • Installed itunes and now cant see my cd stations on my computer

    so first off thanks for forceing me to install this virus on my computer that completly caused tons of problems for me.
    So the problem i have is that i installed Itunes and now i cant see my cd stations i tryed to update the drivers and it doesent work. so what can i do to solve this problem except to format my whole dam computer.
    The CD/DVD station that i use is a sony optriac AD7280s

    Hello there, elainefromnaul.
    It sounds like your iPod nano has stopped being recognized in iTunes. the following Knowledge Base article offers up some great, in-depth steps for troubleshooting that very issue:
    iPod not appearing in iTunes - Apple Support
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • Turned on my ipad,dark screen lights up but cant see a thing... can anybody tell me how to fix this

    Just turned on my ipad 2 wi-fi , black screen lights up to lighter black but I cant see a thing on it... does anyone have any ideas on what's wrong with it?

    Try this First... No Data will be Lost...
    Press and Hold the Sleep/Wake Button and the Home Button at the Same Time...
    Wait for the Apple logo to Appear...
    Usually takes about 15 - 20 Seconds... ( But can take Longer...)
    Release the Buttons...
    If no joy... Try a Restore...
    1: Connect the device to Your computer and open iTunes.
    2: If the device appears in iTunes, select and click Restore on the Summary pane.
    Restoring  >  http://support.apple.com/kb/HT1414
    3: If the device doesn't appear in iTunes, try using the Steps in this article to force the device into Recovery Mode

  • Help! -Itunes wont sync, Set-Up Assistant pops up, Cant see iPod contents..

    I have several problems happening at once - please help if you can!
    When I connect to iTunes, my iPod starts to sync, but then I get an error message "Cannot synchronize ----'s iPod. Unknown Error (-48)"
    It then jumps straight to the Set Up Assistant, as if its the first time I've connected my iPod! (I've had it for a year now). I'm too scared to go through that option in case it wipes the music/video off my iPod.
    After all this, my iPod's name Imine) is actually visible in the left side panel of iTunes - BUT, i cant see any of the contents ie songs, video etc.
    Funny thing is, I can still load songs & video onto the iPod, and it synchronizes and saves. But, I just cant see anything thats on the iPod (meaning I cant edit or delete, which is annoying), as iTunes only recognizes it as a brand new ipod.
    So, what can I do?
    I've tried to reset the Ipod, and reloaded iTunes. I've even used an earlier version of iTunes on a different computer and the exact same thing happens there (which leads me to believe somehting happened to the iPod).
    I dont want to restore the iPod - I have nearly filled the 160GB capacity and I simply cannot back it up anywhere as no computer i have has enough memory and all my original music is overseas at home.
    Why is itunes not recognising the ipod, but it still saves data on it??? How can I bypass the Set Up assistant?? (its irritating).
    Please help!!
    JJ LA

    I am also having the same problem. This is my second ipod (I've added a shuffle and already had a nano). The nano works fine. When I connect the shuffle, it is grayed out in the left pane. The main view only shows two tabs, Settings and Contents. It doesn't seem to matter how I have the syncing setup.

  • FCP HD cant see video NO WHERE!!!

    Ok here it is last night I imported video in, and now today I went to start working on it and now I cant see nothing, no video at all. I reinstalled my FCP but nothing. When I put clips into my time line all I see is black, but I can hear the sound. I played it throught the camera but nothing. I opened up another project that was working that I looked at the night before to check on somthing, and today I can't see it. If I double click on the clip in the time line it comes up where I can edit it (like speed and what not) and it will play but its slow. Can anybody help me, this is a hot job that has to be done in like 2 days. HELP PLEASE!!! I NEED MY FCP ASAP!!!!!! :'(

    First thing to do is select your canvas and press the w key and see if your picture pops up. Or click up the little pulldown and select Image or Image + Wireframe (not just Wireframe).
    If that doesn't help, borrowing from the ever popular Shane's Stock answers:
    Shane's Stock Answer #8:
    If for some reason you can't view your timeline on your external monitor, there are a few things to try:
    1) Make sure that the camera/deck is connected and powered on BEFORE you open FCP.
    2) In the FILE menu select AUDIO/VIDEO Preferences and make sure your signal is being sent out thru Firewire DV.
    3) Go to the menu and select VIEW>EXTERNAL>ALL FRAMES.
    4) Go to VIEW->refresh A/V devices
    5) Make sure the Log & Capture window is closed
    6) Cycle power to the deck or camcorder
    7) Shut down the Mac and then restart (couple this with cycling power to the deck or camcorder)
    If you want it to play in both the canvas and the external monitor you need to go to the FINAL CUT PRO menu and select AUDIO/VIDIO settings and make sure MIRROR ON DESKTOP is selected under the PLAYBACK OUTPUT section
    Patrick

  • I cant see any thing on my screen

    i cant see any thing on my screen

    Charge the iPod battery for at least 2 hours, there  wont be any sign of life for the first 30 minutes of charging, so be patient, then the screen will display a charging sign and "do not disconnect" sign.
    After charging till full charge, preferably 4 hours
    Toggle the Hold switch, make sure you dont see the red mark when you do the  next step
    Reset the iPod -> Press Menu and Center button simultaneously for about 10 secs till the Apple Logo comes ON
    Then release the buttons
    Select your preferred language.
    Here is the Apple support Article on the 5Rs
    http://www.apple.com/support/ipod/five_rs/classic/
    Good Luck!

  • Question ios6 messages had a edit feature i could hilite the message and forward it on in ios7 the edit feature i cant see or am i doing something wrong any ideas

    question ios6 had a edit feature in messages i could hi lite and forward message pic etc in ios7 cant see edit to be able to do the same am i missing a new way to do this or has apple forgotten to include

    That certainly doesn't sound right, but it's such a fundamental part of file sharing that it needs further investigation.
    First thing to check is whether guest logins are available, and whether you're actually logging in as a guest rather than a registered user when the incorrect password is used.
    The server's logs (or Server Admin) should be able to confirm this.
    While I might expect an incorrect password to reject the login, if you have guest access you're essentially saying you don't care about authentication anyway, so it might be the issue.
    The second thing to check is whether the same happens on other forms of login to the server, e.g. ssh, SMB, etc.
    That will help identify whether the problem relates to AFP or something more global on the server (e.g. there may be a local account for userA and userB that's being used rather than the Open Directory account you expect.

  • Cant see others in video conference

    When i join a video conference with more than once person i cant see anybody else but myself.
    When i start a video conference and add people one by one...the first person can see everybody...but the 2nd and 3rd cant see anybody else.
    whats going on????

    Hi Brohim,
    Welcome to the Apple Discussions
    What is your System Preferences > Quicktime > Streaming tab set to ?
    It should be set to match your download speed or a max of 1.5meg
    What is your download and upload speeds ?
    http://www.bplspeedtest.com/broadband-speed-test.php
    11:46 PM Thursday; July 20, 2006

  • HT4623 How to stop third party apps download with out you permission from ATT partners that cant see any connections on your account due to you not being the prchaser?

    How to stop third party apps download with out you permission from ATT partners that cant see any connections on your account due to you not being the purchaser or on account as long as someone else is paying they can not hold legal resposible there third privacy  due to legal privacy laws.

    Then you should read these.
    http://forums.macrumors.com/showthread.php?t=1804704&highlight=sonnet+tempo+pro
    http://forums.macrumors.com/showthread.php?t=1721573&highlight=sonnet+tempo+pro
    This was strange but has to do with how startup disk and nvram interact
    http://forums.macrumors.com/showthread.php?t=1795765
    I think your problems were solvable and not that the Sonnet card and 5,1 is not bootable, in fact the 5,1 is easier, there are more supported cards.
    I have the 1,1 where the Sonnet Pro is recommended but for data only and are not bootable because of the 32-bit EFI firmware. NOT the 4,1 and 5,1. The 2008's are problem child and have a mix of PCIe 1.1 slots, first implementation of EFI64 that also has problems. Also the 4,1 has two PCIe 2.x slots 3 and 4 that share a controller but that simply limits bandwidth.
    I would have left the TRIM support and NVRAM changes in Yosemite to a separate thread if you wanted to focus on the Sonnet Tempo Pro support in Mac Pro 2010-12 5,1s.
    Also the make of SSD can vary and they also have their own firmware as do bootable controllers along with the EFI of the Mac, all of which have to work together.  Meaning it might be that Samsung 840 va 840 EVO vs 840 Pro will all be slightly different but my experience is Samsungs work well (as do others like Crucial with the proper firmware - and there was/is an issue with the firmware of the Samsung 840 but not with booting).
    The PCIe card gets seen and treated as external and therefore 'eject' but of course you can't when it is the system boot drive.
    One thing I found last week and meant to mention:  After installing or changing PCIe cards, RESET SMC made all the difference in the world with the long boot delay. Some PCIe cards will add a few seconds, system has to search the device tree which now shows another controller with multiple devices - and sometimes NVRAM and SMC are what I will call "dirty" and need to be rebuilt and reset.

  • Cant see flash on metacafe

    Hi, I cant see any video on metacafe
    in ie8 with the latest flash player installed.
    I can watch video on youtube and dont seem to have the problem with other sites,just metacafe.
    I tried uninstalling using the uninstaller, reinstalling,done it in safe mode, run all sorts of cleaners,still get the same result
    I tried disabling norton to see if that was the problem,nope. Tried disabling google toolbar and still the same.
    Can anybody help??????
    Thanks in advance

    Have you tried removing temporary internet files of ie8 yet? And not by means of a 3rd party software but just in ie8 options menu.
    What could have happened is that the player didn't load properly the first time and now the improperlly loaded files are cached.

Maybe you are looking for

  • Automatic posting (user-exit, BADI, BTE...)

    Hello, saperos (as we are known in Spain). We have a requirement from our customer in order to post automatic documents (with call transaction or BAPI) just after the posting of another. I have doubts about the mechanism to do this, maybe a BADI, BTE

  • Unsupported Video Format

    I have 3.1.3 version of Aperture and am running Lion. Since the upgrade movies I shoot on the iPhone are showing in Aperture as "Unsupported Video Format" and I cannot view them. Sure one would think that and Apple phone and Apple software would work

  • Regarding Screen Exits

    Hi all, In tcode XD02 i want to add 3 fields (account no. , Branch and Bank Details)..In Standard Screen. What is Screen Exit For the XDO2? Can Any One Tell the Step by step process to create Screen Exits. How To work with  Tcodes CMOD And SMOD?

  • How to extract the .ecp files?

    We need to extract some *.ecp files. Please help tell whether a double click would be enough? We did not get the files yet, just prepare the procedure. Thanks!

  • Jsf command button navigation

    Hey can anyone tell me if this is correct way to go to the back page using the command button. <navigation-rule> <from-view-id>/History.xhtml</from-view-id> <navigation-case> <from-outcome>admin</from-outcome> <to-view-id>/Admin.xhtml</to-view-id> </