Getting servlets to work in the directory you want

Ok, I've searched for a few hours and spent more time that I should with Tomcat, and I'm sure others have asked similar questions, but I'm still unable to solve a simple problem:
I installed Tomcat (4.0.4), edited the path (common/lib) and classpath (servlet.jar).
JSP files work beautifully, as do the example servlets. Even when I created a servlet and put it into /webapps/ROOT/WEB-INF/classes/myServlet it worked well. But when I tried to create my own directory, i.e. /webapps/ROOT/my-directory/WEB-INF/classes/myServlet I keep getting the 404 error of death.
I tried to add a context line to the server.xml file, but Tomcat will not restart properly. Is there a special place within the file to add it? Or is there something else I'm missing?
Am I correct in saying that you EITHER put a line into the classpath OR server.xml? I tried the line in the classpath with no success. Or is it something to do with web.xml - I played with it but again no success.
Thanks,
Dan
PS I AM aware you must call the servlet file by using "servlet/myServlet"

Well damn, after re-installing Tomcat 4.0.4 and doing it all again, it worked! Thanks to both of you for your help!
SO maybe for others (or for myself when I forget later) I did the following:
1. Installed Tomcat 4.0.4 in C:\Tomcat
2. Set the classpath:
.;C:\Tomcat\common\lib\tools.jar;C:\Tomcat\common\lib\servlet.jar;%Classpath%;
3. Set the path: C:\Tomcat\common\lib
4. Set CATALINA_HOME=C:\Tomcat
5. Put my jsp,html files in /webapps/my-directory, created WEB-INF/classes and put the servlet classes in there
6. Added the context in server.xml: <Context path="/my-directory" docBase="my-directory" debug="0" privileged="true" reloadable="true" />
7. Added the 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>
<servlet>
<servlet-name>
Test
</servlet-name>
<servlet-class>
Test
</servlet-class>
</servlet>
</web-app>
That's it! I hope I didn't miss anything...but it worked for me with a little help from my friends.
PS I really think there should be better instructions... I consider myself a fairly good java developer, but getting this s@#! to work took too long ;)
Dan

Similar Messages

  • Where can I find the plugin to open camera raw files for Nikon D810 for Photoshop CS5.1? I've looked around the site but cannot get this to work.. Thank you.

    Where can I find the plugin to open camera raw files for Nikon D810 for Photoshop CS5.1? I've looked around the site but cannot get this to work.. Thank you.

    See for yourself which version of ACR is needed for that camera’s RAW files
    http://helpx.adobe.com/creative-suite/kb/camera-raw-plug-supported-cameras.html
    then check your version (Photoshop > About Plug-In > Camera Raw).
    Your version of Photoshop does not support that version of ACR.
    You could use the free DNG Converter.

  • When trying to open lightroom I get a message that says, "The lightroom.exe that the short cut refers to has been changed or moved, so the short cut will no longer work properly.  Do you want to remove this short cut?  The program has opened and worked fi

    When trying to open lightroom I get a message that says, "The lightroom.exe that the short cut refers to has been changed or moved, so the short cut will no longer work properly.  Do you want to remove this short cut?  The program has opened and worked fine in the past.

    You have (probably accidentally) moved or deleted the Lightroom program. You need to find it (have your operating system search for lightroom.exe) and move it back to where the shortcut expects it to be.

  • How do you get Groups to work on the IPAD? They imported and show in Address Book but when used, only the first address picks up.

    How do you get Groups to work on the IPAD. They show in address book but only the first name is used when entering.

    When you select the bookmark on the upper left, you should be able to see multiple groups.
    For the groups page, select the bookmark on the upper right to see the individual entries.

  • I have a pioneer 50 inch plasma   I purchased new from the company back in 2005.   I tried to hook up an Apple Tv to the pioneer receiver that came with the TV.   I can not get it to work.   The receiver has two HDMI  inputs in the back.

    I have a pioneer 50 inch plasma + I purchased new from the company back in 2005.   I tried to hook up an Apple Tv to the pioneer receiver that came with the TV.   I can not get it to work.
    The receiver has two HDMI  inputs in the back.  However they say they are not for PC's.  Furthermore they must be set up by going to the home menu.    I tried everything, but I can not get the receiver to talk to the Apple TV. I even tried a connector that uses an HDMI to the Apple TV that has the other side of the cable as 5 RCA cables.  I could not get the receiver to see the Apple TV.   I have a newer TV in the house, it has no problem talking with the Apple TV.  But this older system seems to be handicapped in its ability to talk with the newer Apple TV system.
    My Email is [email protected] 
    Do you have any suggestions
    Thanks
    Bob

    I could not access the Apple TV on the television.   If I put the Apple TV directly into by TV, I have an external sound system (entertainment system), therefore I worry that I would by pass the audio.
    Thanks for taking your time to attempt to help!   Any more suggestions would be greatly appreciated.
    Bob

  • HT4623 My Iphone 4s just stopped during the latest update and now the screen show the Apple icon and an white bar beneath.  I can no longer get anything to work on the phone!!  Where to from here??

    My Iphone 4s just stopped during the latest update and now the screen show the Apple icon and an white bar beneath.  I can no longer get anything to work on the phone!!  Where to from here??

    You can not merge accounts.
    Apps are tied to the Apple ID used to download them, you can not transfer them.

  • I plug in my printer and I get a message that says, "the disk you inserted is not readable." It didn't do this before but after I installed a segate hardrive software. I have removed the segate hardrive software but the message still appears.

    I plug in my printer and I get a message that says, "the disk you inserted is not readable." It didn't do this before but after I installed a segate hardrive software. I have removed the segate hardrive software but the message still appears. What can I do to remove this error.

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It won’t solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    Third-party system modifications are a common cause of usability problems. By a “system modification,” I mean software that affects the operation of other software — potentially for the worse. The following procedure will help identify which such modifications you've installed. Don’t be alarmed by the complexity of these instructions — they’re easy to carry out and won’t change anything on your Mac. 
    These steps are to be taken while booted in “normal” mode, not in safe mode. If you’re now running in safe mode, reboot as usual before continuing. 
    Below are instructions to enter some UNIX shell commands. The commands are harmless, but they must be entered exactly as given in order to work. If you have doubts about the safety of the procedure suggested here, search this site for other discussions in which it’s been followed without any report of ill effects. 
    Some of the commands will line-wrap or scroll in your browser, but each one is really just a single line, all of which must be selected. You can accomplish this easily by triple-clicking anywhere in the line. The whole line will highlight, and you can then copy it. The headings “Step 1” and so on are not part of the commands. 
    Note: If you have more than one user account, Step 2 must be taken as an administrator. Ordinarily that would be the user created automatically when you booted the system for the first time. The other steps should be taken as the user who has the problem, if different. Most personal Macs have only one user, and in that case this paragraph doesn’t apply. 
    Launch the Terminal application in any of the following ways: 
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.) 
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens. 
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid. 
    When you launch Terminal, a text window will open with a line already in it, ending either in a dollar sign (“$”) or a percent sign (“%”). If you get the percent sign, enter “sh” and press return. You should then get a new line ending in a dollar sign. 
    Step 1 
    Triple-click the line of text below on this page to select it:
    kextstat -kl | awk '!/com\.apple/{printf "%s %s\n", $6, $7}' | open -f -a TextEdit 
    Copy the selected text to the Clipboard by pressing the key combination command-C. Then click anywhere in the Terminal window and paste (command-V). A TextEdit window will open with the output of the command. If the command produced no output, the window will be empty. Post the contents of the TextEdit window (not the Terminal window), if any — the text, please, not a screenshot. You can then close the TextEdit window. The title of the window doesn't matter, and you don't need to post that. No typing is involved in this step.
    Step 2 
    Repeat with this line:
    { sudo launchctl list | sed 1d | awk '!/0x|com\.(apple|openssh|vix)|org\.(amav|apac|cups|isc|ntp|postf|x)/{print $3}'; sudo defaults read com.apple.loginwindow LoginHook; sudo crontab -l; } 2> /dev/null | open -f -a TextEdit 
    This time you'll be prompted for your login password, which you do have to type. Nothing will be displayed when you type it. Type it carefully and then press return. You may get a one-time warning to be careful. Heed that warning, but don't post it. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator. 
    Note: If you don’t have a login password, you’ll need to set one before taking this step. If that’s not possible, skip to the next step. 
    Step 3
    { launchctl list | sed 1d | awk '!/0x|com\.apple|org\.(x|openbsd)/{print $3}'; crontab -l 2> /dev/null; } | open -f -a TextEdit 
    Step 4
    ls -1A /e*/{la,mach}* {,/}L*/{Ad,Compon,Ex,Fram,In,Keyb,La,Mail/Bu,P*P,Priv,Qu,Scripti,Servi,Spo,Sta}* L*/Fonts .la* 2> /dev/null | open -f -a TextEdit  
    Important: If you formerly synchronized with a MobileMe account, your me.com email address may appear in the output of the above command. If so, anonymize it before posting. 
    Step 5
    osascript -e 'tell application "System Events" to get name of every login item' | open -f -a TextEdit 
    Remember, steps 1-5 are all copy-and-paste — no typing, except your password. Also remember to post the output. 
    You can then quit Terminal.

  • It used to be that when I created a pdf from a word or publisher document, hyperlinks worked fine. Now I cannot get them to work unless the text displayed for the link is the complete address and it all appears on one line. Why?

    it used to be that when I created a pdf from a word or publisher document, hyperlinks worked fine. Now I cannot get them to work unless the text displayed for the link is the complete address and it all appears on one line. Why?

    You can print to the Adobe PDF printer, but that only creates links that Acrobat or Reader recognize as such. That is the reason for needing the entire URL on one line. It is not actually an embedded link, but one created by Acrobat on the fly. With OFFICE 2013 you have two choices: 1. create the PDF with the print to Adobe PDF and then add the links in Acrobat so that they are complete or 2. I think the WORD save as PDF or XPS will create the PDF with links, but not sure. If so, that would be the quickest solution for you, but be aware of potential problems with the MS plugin.
    Of course, the third option is to upgrade to XI which can be done with AA 9. You will probably not be eligible for a for an upgrade to whatever the next version will be.

  • I am trying to uninstall itunes and keep getting a reject that reads "the feature you are trying to use is on a network resource that is unavailable."  Its windows...help!

    I am trying to uninstall itunes and keep getting an error that reads "the feature you are trying to use is on a network resource that is unavailable."  Itunes on windows.  Help!

    (1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    (2) Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
    (3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
    (4) In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    (5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • HT1925 When I try to uninstall apple updater I get a message that says " The feature you are trying to use is on a network resource that is unavailable." I dont understand this. How can I finish uninstalling the apple update program?

    When I try to uninstall apple updater I get a message that says " The feature you are trying to use is on a network resource that is unavailable." I dont understand this. How can I finish uninstalling the apple update program?

    (1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    (2) Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
    (3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
    (4) In the list of programs that appears in CleanUp, select any Apple Software Update entries and click "Remove", as per the following screenshot:
    (5) Quit out of CleanUp, restart the PC and try another iTunes install using an iTunesSetup.exe (or iTunes64Setup.exe) downloaded from the Apple Website:
    http://www.apple.com/itunes/download/
    Does it go through properly this time?

  • For some reason I cannot download and install the latest version of iTunes. 11.0.2. Could you help please? Each time I try, I get a command box saying 'The feature you are trying to download is on a network resource that is unavailable. Click Ok to try ag

    For some reason I cannot download and install the latest version of iTunes. 11.0.2. Could you help please? Each time I try, I get a command box saying 'The feature you are trying to download is on a network resource that is unavailable. Click Ok to try again or enter an alternate path to a folder containing the installation package iTunes.ms in the box below.
    Please help!
    Many thanks in advance
    Ben Bentley
    West Midlands
    UK

    (1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    (2) Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
    (3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
    (4) In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    (5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • I uninstalled itunes, and tried to redownload/install it, now I can't even get it installed, it says " The feature you are trying to use is on a network resource that is unavailable" What do I do to get itunes back

    I Removed itunes from my pc, and tried to redownload/install it, now i can't even get it installed, it says " The feature you are trying to use is on a network resource that is unavailable" What do i do to get itunes back on my pc?

    This kind of problem can often be fixed with the  microsoft Installer cleanup utility.
    Unfortunately the Microsoft Installer Cleanup utility has been withdrawn by Microsoft because of compatibility issues with Microsoft Office so you will need to find a copy elsewhere – the installer is msicuu2.exe. You need version 3.
    Google  msicuu2.exe download
    mydigitallife in the above search has a copy of version 3
    Check for malware before installing it.
    After installing, To run the program  – All Programs>>Windows Install
    If you get  permission denied error, Try Run as Administrator – an option if you right click on the program.
    When you run the cleanup utility, look for any instance that you find of iTunes and remove it.
    It is possible that you will have to remove other apple programs if removing iTunes doesn't allow you to install iTunes. Post back with any furtyher error messages if there is a problem.

  • Upgraded to IO6, seems like the amount of system memory to run is higher, this causes issues with some Apps. I can't get SIRI to work because the amount of free system memory is not enough. how can I tell what is eating the system memory?

    Upgraded to IO6, seems like the amount of system memory to run is higher, this causes issues with some Apps. I can't get SIRI to work because the amount of free system memory is not enough. how can I tell what is eating the system memory?

    Upgraded to IO6, seems like the amount of system memory to run is higher, this causes issues with some Apps. I can't get SIRI to work because the amount of free system memory is not enough. how can I tell what is eating the system memory?

  • I got an iTunes card as a gift and when I enter the code to redeem it I get a message that says "the code you entered has not been properly activated. Please contact iTunes..." Please advice.

    I got an iTunes card as a gift and when I enter the code to redeem it I get a message that says "the code you entered has not been properly activated. Please contact iTunes..." Please advice.

    what did itunes say when you contacted them?

  • I reloading LR onto a new lap top.    I have the orginal LR 1 disk with correct Serial #.   I have downloaded it,  every time I try to open the program I get the "Do you want to buy or I have a Serial Number Page".    I fill out the page include the seria

    I reloading LR onto a new lap top.    I have the orginal LR 1 disk with correct Serial #.   I have downloaded it,  every time I try to open the program I get the "Do you want to buy or I have a Serial Number Page".    I fill out the page include the serial # accept terms and enter.   All fine and good seems normal.  When I try to open LR I get the damn "Do you want to buy" page.   I do I get past this BS?

    What version of LR are you trying to activate? A serial number for LR 1 will not activate LR versions 2 - 5, but it will enable you to purchase LR 5 at the upgrade price and activate it.

Maybe you are looking for

  • Can I create private class in ABAP?

    Hi all, Can I create private class in ABAP? Please reply me its interview question. Thanks , Vishal Moderator message : Interview type questions not allowed, read Forum Rules Of Engagement before posting.  Thread locked. Edited by: Vinod Kumar on Jan

  • Unable to download PDF files

    Hello, I have installed on my desktop computer the following products: Adobe AIR, Adobe Creative Cloud, Adobe Flash Player 15 ActiveX, and Adobe Reader XI (11.0.10).  However, I am unable to download the PDF files that I need to use for work.  On my

  • DS 6.2 database corruption

    Hi, Last week we our directory database became corrupt. I managed to get things restored BUT i suspect that I'm in need of a patch. -bash-3.00$ /opt/SUNWdsee/ds6/bin/dsadm -V    [dsadm] dsadm               : 6.2                  B2007.192.2248 [slapd

  • I forgot my admin password, help?

    After years having my mAc opened I forgot my Admin password. I do have access to everything desk top , programs everything..except when i need to download a upgrade it ask for my admin password.. I dont have a restart disk..help

  • Unable to open existing Illustrator documents

    Help! I cannot open existing Illustrator documents! I haven't changed anything. All of a sudden when I go to File and choose to open a document it just freezes the application. I can create new documents, but not open old ones. This is a big problem.