Can get this Servlet to Work! New Java User needs help.

I have been using a text from New Riders to learn about creating server applications, and am using Tomcat as the server in a Windows XP environement. As per the instructions, to create a new application and path, I added the following path under the webapps directory, that sits under my Tomcat directory:
myApps
--WEB-INF
----classes
I then create copied Java class code, listing below, and compiled, put the class in the classes directory in my new directory path. The code is simple, here it is:
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
public class TestingServlet extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out = response.getWriter();
out.println("<HTML>");
out.println("<HEAD>");
out.println("<TITLE>Servlet Testing</TITLE>");
out.println("</HEAD>");
out.println("<BODY>");
out.println("Welcome to the Servlet Testing Center");
out.println("</BODY>");
out.println("</HTML>");
I then created a file called web.xml in the WEB-INF directory, as w follows:
<?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>Testing</servlet-name>
<servlet-class>TestingServlet</servlet-class>
</servlet>
</web-app>
I started the Tomcat server process, and pointed my browser to the URL http://localhost:8080/myApp/Servlet/TestingServlet. I received the following error
type Status report
message /myApp/Servlet/Testing
description The requested resource (/myApp/Servlet/Testing) is not available.
After searching some information on the web, I found some references to context information, that should be included in another file, called server.xml, that resides under the conf directory in the Tomcat root. I found it, and added the following within the "host" tags, just after the last ending /context tag, for the example directory that came with Tomcat:
<Context path="/myApp" docBase="myApp" debug="0" reloadable="true" >
</Context>
I stopped and restarted the Tomcat server. This time, I checked under the Manager page of Tomcat, and found the myApp directory listed, and apparently "started", whatever that means
pointed my browser to the URL http://localhost:8080/myApp/Servlet/TestingServlet. I still receive the following:
type Status report
message /myApp/Servlet/Testing
description The requested resource (/myApp/Servlet/Testing) is not available.
I tried one more thing. I put my class under the "examples" directory that comes with Tomcat, change the web.xml file that resides under its WEB-INF directory, and tried to see if I can get the servlet to work. And it actually does, which leads me to believe, I did something wrong setting up the directory environment in Tomcat.
At this point I am at a loss to figure out what I did wrong, and what else I can do to fix this. Any help, suggestions, would be great.

ok, I have got your servlet runnig on Jboss with Tomcat,
The war file contents are
myApp/
META-INF/
META-INF/MANIFEST.MF
WEB-INF/
WEB-INF/classes/
WEB-INF/classes/TestingServlet.class (No package)
WEB-INF/web.xml
Web.xml
<web-app>
<servlet>
<servlet-name>Testing</servlet-name>
<servlet-class>TestingServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Testing</servlet-name> <------- My mistake use Testing
<url-pattern>/servlet/testing/*</url-pattern <------- lowercase S
</servlet-mapping>
</web-app>
url
http://localhost:8080/myApp/testing/blah

Similar Messages

  • I accidently hit the restoe button! Is there anyway i can get my apps and music back? I need help thanks

    I accidently hit the restoe button! Is there anyway i can get my apps and music back! I need help thanks:)

    Try restoring the iPod from backup. See the restoring section of the following:
    iTunes: Backing up, updating, and restoring your iPhone, iPad, or iPod touch software
    If the apps and music are in your itunes library just sync them back to the iPod if necessary.  If the apps and music are not in your iTunes library see the following.  Not all options are available if you are outside the USA and do not have the latest iOS and iTunes.
    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • New Mac user, need help accessing windows shares

    Hi All,
    I have a new MBP 13" and want to be able to easly access shared folder on my PC network. None of the PC's appear under the 'Shared' left menu in the finder, not even my aging eMac.
    I have successfully used connect to server and smb the pc name, but this seems to wok once, then when I go to reuse it, i can not access it again. deleting the save server favourite and rebooting works occasionally, however for the most part it is bery hit and miss. My thoery is that if you can access it once, you should be able to again and again.
    Obviously none of my pc's have any issues accessing the shares, it is just the mac . I have input the windows workgroup in the WINS section of Network Settings as well as my router ip address.
    Can anyone advise how to get the pc's to appear under the shared tab in the finder.
    At the moment, I am starting to regret buying the Macbook Pro, and really thought this type of issue would have been sorted out on the Mac side by now. But alas, it seems that I will just use windows 7 on the macbook pro until I can get this sorted. I can't not have access to windows data stores.
    Any help will be appreciated. I have tried to resolve this by viewing similar threads, but have not found a reliable solution yet.
    GeekGuy

    Really ... no-one can shed some light on this situation?
    Can someone at least recommend a forum where I can get some help.

  • I can't get Flash Player to work at all I need help PLEASE!!!

    I have been trying for close to 1 week now to figure out how to get this flash player to work on both IE & Firefox and it's driving me crazy. I'm running a Windows 7 Home Premium Edition 64-bit not sure what other info you need but I'm here if you need more. I just want to get this fixed so hubby can play his games and I can play mine.
    Thanks so much

    Games require not only the latest Flash Player, but the least Shockwave as well. I recommend a complete “clean install” for both.
    Download the following by right clicking and  selecting either "Save target as"(IE) or "Save Link As"(Firefox):
    Shockwave Player Uninstaller
    Flash Player Uninstaller
    Flash Player for ActiveX (Internet Explorer)
    Flash Player Plug-in (All other browsers)
    Shockwave Player 12 FULL Installer (Other browsers)
    Save the files - DO NOT RUN ANYTHING YET.
    Reboot your system.
    BEFORE opening anything, run the UNINSTALLERS to remove Shockwave and Flash Player,
    Once they’ve finished, go to: C/Windows/System32 and delete the Macromed folder.
    Go to: C/Windows/SysWOW64 and delete the Macromed folder.
    Open your Registry Editor (Start>Run or press the Windows key + R and tope “regedit” [minus the quotes] and click OK)
    In the Registry Editor, go to: HKEY_LOCAL_MACHINE/SOFTWARE and delete the Macromedia folder.
    Go to: HKEY_CURRENT_USER/Software and delete the Macromedia folder there.
    Close the Registry Editor and empty your Recycle Bin.
    Run the Flash Player installers, and the Shockwave FULL installer for Firefox.
    Lastly, using IE, visit: http://get.adobe.com/shockwave/otherversions/ to download and install the Shockwave FULL installer for ActiveX.

  • NEW MAC USER NEED HELP PLEASE!!!

    Hi All I am a new mac user I am a PC lover, but just recently purchased a mac notebook I have the 13inch notebook, and I am completely lost....do these thinsg come with anti virus on or do i have to install...if I do where can I find it as far as where it is and where I can check it Im use to my computer icon again any advice is welcome THANKS

    Hi - and congrats
    From this point on don't even think about security/virus software ...it's just not needed.
    Here's a link to help you get started with your Macbook...
    http://www.apple.com/support/switch101/
    Have fun!

  • New Mac user needs help: some audio doesn't play...

    Since I purchased my MacBook, I haven't been able to listen to any audio on the internet (movie trailers, youtube.com, etc.) I found this previous discussion: http://discussions.apple.com/thread.jspa?messageID=2784099&#2784099 which led me to this link: http://docs.info.apple.com/article.html?artnum=300832.
    I did not have the Audio Midi Setup utility that the article required, but I downloaded Pacifist and installed the utility. When I opened it, I was disappointed to find that under 'Audio Output,' it simply said 'Output is not supported.' Any suggestions on how to get my online audio to play or how to get the output to be supported? Thanks a lot from a recent convert to Mac OS X!
    Sara
    MacBook   Mac OS X (10.4.6)  
    MacBook   Mac OS X (10.4.6)  

    The safer way to run is set up a user account without administrator privileges for normal use, and reserve the administrator account for software installation and system maintenance. Running from the user account will then prevent you from accidentally moving or deleting system files.
    If there are files missing from your system, and you are sure you didn't do it accidentally, you have serious problems. Either the system wasn't installed properly at the factory or the disk is going bad. If the Mac is used, the previous owned may have messed with the system. In either case I would recommend backing up all your files to a CD or DVD, then using the OSX install disk, initialize the drive with the zeroing option, and reinstall OSX. Then create a non-administrator account for normal use. It is a bit of work, but then you will know where you are staring from. If system files again vanish when you are not using an administrator account, you know the disk is bad, and can get Apple to replace it.
    Another thing you should do is run the Extended Hardware test. It should be on a disk that came with the computer. Read the fine print on the disks. You start it by holding down D (Diagnostics) when booting.
    Audio not working with some applications does happen but system files should never go missing.

  • New PC user needs help moving stuff from MAC

    I have just had to resort to getting a PC and I don't know how to get all my stuff from my mac to my PC. Specifically; iPhoto library, itunes folder, mailboxes and signatures in Mail, bookmarks in firefox or safari, 'address book' v cards, and all my textedit docs (AAARRRGGHHHH!).
    Can anyone help me? My new PC is a Quad core acer running vista.

    Apple devices are designed to only allow you to sync to one itunes library at a time. If you try, it will replace everything on the deivce with the itunes library you are syncing to.
    If she has already synced her ipad to another computer, then this is normal behavior.
    It would be best to create a library just for her. If you can import/export the music and photos on the computer into her own itunes library.
    Syncing multiple devices with one computer
    http://support.apple.com/kb/HT1495
    The reason that content from her ipad is showing up on your iphone is probably due to you both sharing the same apple id and having automatic downloads turned on in the settings.
    You can turn this off by going to settings/itunes and app stores/automatic downloads/turn off

  • New airport user need help setting up a pc on the network

    went and bought a airport extream today and my mac works fine on it but i also have a pc and need help getting it to work with the airport express. it seems to see the airport in the network slection screen but after i put in the pass i get nothing and it returns to the "chose a wireless network" can anyone help?

    Thanks for the reply.
    That's interesting, I guess I had assumed that would be a basic thing.
    Right now the 4000 number is in port 1, and then 4244 is in port 2. So if no one else is on the phone, and my  boss picks up his phone, dials 9 then XXX-XXXX, he will be routed outbound on the 4000 line on port 1. Then while he's talking, if I pick up the phone and dial 9 then XXX-XXXX, I will be routed out on the 4244 line on port 2.
    Am I understanding that correctly?
    If that is the case, then that is a bit frustrating. Our 4000 line has everything on it, call waiting, caller id, long distance, etc. But the 4244 line is just a basic service. So if I'm calling local or toll free, I don't want to tie the other line up in case someone else needs to make a long distance call to a client. Is there any work around to that at all? Is there any way to use steering digits to point the call to the right line? Would we have to put the PSTN lines on seperate SPA400's?
    Again, any comments and suggestions are much appreciated!
    Message Edited by VoIP_Me on 07-30-2008 06:27 AM
    Message Edited by VoIP_Me on 07-30-2008 06:28 AM

  • New Apple User needs help with Canon MX870

    I recently bought this printer but I can't figure out how to keep it hooked up to the wireless network at all times. RIGHT NOW I HAVE TO GO THROUGH THE WHOLE SET UP PROCESS every time on the printer to connect it to the network. This defeats the purpose, it would be much easier to just hook a usb cable up to it so i can just click and print? Surely I'm missing something, can you please help me set this thing up right so I don't have to go through that whole process every time to get on wireless. I want to be able to turn on my computer and print something without any set up required. Please help!

    Jeff I would recommend contacting AppleCare, the number in the US is 800-275-2273. Also I would also recommend following Apple's suggestion of leaving the computer on 24/7 and letting it sleep when not being used. You can find this information in your owners manual.
    Roger

  • New mac user needs help transfering files from Dell...

    I have a Dell running Windows XP and need help transfering the files from the dell to the mac.
    Also I have no idea what OP system I have, how do you tell which one you have???

    Go to the blue Apple menu and scroll down to "About this Mac"
    In the summary window that opens you will find the following information:
    Mac OS X version (assuming you are running OS X)
    Processor speed.
    Memory
    Startup disk
    The More Info button will take you to an in-depth overview of hardware, network set-up and installed software.
    As far as transference is concerned, you can either transfer files via CD, DVD, external hard drive... or by networking the two computers.
    Here's a link for an overview concerning Mac to PC connectivity:
    http://docs.info.apple.com/article.html?artnum=19652
    I hope the above helps.
    Reagrds
    Tony
    G5 iMac, G4PB, iMac DVD 450Mhz   Mac OS X (10.4.2)  

  • New mac user needs help with default display

    hi, i am a new mac user and i accidentally changed the default display. I want to change it back to the default display but it doesnt seem like any of the options in "system preferences" - "display" change it back to the default out of the box display. please point me in the right direction. thank you!

    im talking about the screen resolution. I went under "system preferences" then clicked on "display" and somehow the mouse clicked on another resolution which stretched everything out. so I went threw all of the difference resolutions and nothing seems to be like the default one. am i missing something? thanks

  • HT1918 I had to change my Apple ID and had a credit in iTunes stores of about $100 - with the new e-mail address this amount is n longer available - any ideas how I can get this amount into my new Address? Tks

    I had to change my e-mail address and therefore also my Apple ID & Password - I had about $100 in Credits from Apple Vouchers which I redeemed - with the new ID this amount is gone - is it possible to regain it?
    Tks
    gerhard Rudolf

    Not on your own. Click here and ask the iTunes Store staff to put it back onto the cards; they'll only do this for completely unspent ones.
    (93896)

  • Brand new Mac user, needs help getting Mac onto Wireless Print Server

    Ladies & Gents,
    After much struggle with PCs in the last two weeks I finally broke down and bought a MacBook. I'm very happy with it, but I am having issues getting hooked into my office's wireless printing network.
    The printer is an HP Color Laserjet 3600n and we're set up with a D-Link DPR 1260 router. I've tried just about everything I know, and even our much-more-qualified-than-I resident Mac user is unsure how to make this work.
    I will continue to search the forum, but I would appreciate any help. I should be off and on throughout most of the day. Thanks!
    -Beaujac

    Two links
    http://www.dlink.com/products/default.aspx?pid=DPR-1260&tab=3
    http://hints.macworld.com/article.php?story=20071210174933679
    FWIW
    /Instant_1

  • New iWeb User needs help regarding multiple sites

    As a new user please excuse me if this has an obvious answer.
    I have 4 web site, very simple, that I have used Frontpage with for years.
    I want to make new websites with iWeb but I am worried I may screw something up.
    I have already created one new iWeb Site and it comes up in the left hand pane as SITE 1.
    I have used that for ages and use a seperate FTP program to publish to my independent Server with no problem. I usually publish to a folder first then use the FTP software to publish to the Server and its fine
    The trouble I have now is probably becasue I don't know how to use iWeb properly but I'll try to explain.
    I made another website and it creates SITE 2 in the left hand pane and I have produced a few pages for that site.
    My problem is that when i go to publish to a folder for the 2nd site, it automatically does the first site as well ?
    In most other programs (like Frontpage) you have to open the individual sites on their own so you can keep everything seperate but iWeb seems to put them all together.
    I now have a folder (on my Apple) with SITE 1 and all its files and in another seperate folder (which I made just for SITE 2) have SITE 1 and SITE 2 and I'm scared to delete the copy of SITE 1 in case it deletes all of it !!
    I wish there was a simple 'OPEN SITE' command in iWeb where you cna pick the opne you want to work on but it doesn't seem to be there.
    If I am missing something obvious I'd be grateful of some advice becasue I really would like to get the other sites made up.
    Message was edited by: russfaefyvie
    Message was edited by: russfaefyvie

    I'll try to make this simple!
    Lets say that you have a website already and you named the site Family.
    You decide you want to create another website for example, My Pets.
    First create a 2 folders a place them where you will remember where they are.
    One of the new folders will be called (Family) (of course both folders are empty at this time. The second folder you created you will name (MY PETS)Ok you with me so far?
    Now lets suppose you have the iweb open to the (Family) website. Quit iweb...
    Go to users/Library/Application Support/iweb. You will see a iweb icon that will say (Domain.Sites2. Drag the domain.sites2 to the (family) folder you just created. Now for your new site that you want to start. (MY PETS) OPEN iweb. You should now be prompted to choose a template. That's because you removed the domain.sites2 out and put it into another folder.
    iweb thinks your are starting a new project and prompts you to choose a template as described earlier. Any pictures you add you should keep them in the separate folder in case you need edit or if you accidentally delete them. For example on the (my Pets site) any pictures you have there you will have in the same folder as the my pets folder you created. What I do is I make additional folders within the site folder I created so I can find things faster. Pets,I would have a pets folder and so on. Do the same for the other folder.(Family)
    Now you created your new website (MY PETS) and you decide you want to go back and work on the (Family) website. Quit iweb. and then go to User/Library/Application Support/iweb... REMOVE the Domain.sites2 (MY PETS) and go to other folder(Family) and drag that Domain.site2 where you previously removed the other domain.sites2.. Open iweb and there it is.
    Tip: When you place a Domain.sites2 into one of the folders you created it is always good to copy the domain.site2 and paste it into the same folder.When you copy and paste a Domain.sites2 the copy of it will say (Domain copy.sites2) This is a good practice to make because if you forget to close a iweb and drag a domain.sites2 out and replace it with another site. iweb will overwrite it when you save and quit. If that happens Just go the the copy you made and drag it to the: users/Library/Application Support/iweb.
    once you drag it to iweb folder click on it once and press enter. You will see the text Domain Copy highlighted. Just delete the word (COPY) make sure it looks like this when your done... Domain.sites2
    Open iweb and there it is.
    Sorry about all the detail as this is a bad habit of mine, but I hope it helps.

  • New logic user, need help with multi-channel inst and aux strips.

    Greetings all,
    So I just purchased a new Mac Pro 2.66 and Logic Pro 7 to run with it. I have been a long time Nuendo/Cubase user on the PC side of things but since I got the Mac I wanted a DAW that was supported fully for the apple platform.
    Anyways, its a world of difference and I am very confused as I wrap my head around the learning curve, so in the meantime I have one important question maybe some one could help me with.
    The question is regarding Aux channel stips for Multi channel instruments. In this scenario I am working with Battery 3, it took me a while to understand that I actually needed to create these aux channels just to have seperate outs in Battery which seems really wierd and overly time consuming.
    As an example in Nuendo once you create the instance of Battery, the audio mixer automatically just creates the corresponding stereo and mono channels instantly. This obviously makes is a sinch to assign Batteries pads to seperate outs for eq/comps for seperate sounds.
    Now the Battery manual doesnt even make a reference to Aux channels for assigning outs in Logic, I actually had to do a Google search to figure this out.
    Anways, sorry for rambling...
    Here is the main issue.... How can I quickly and easily create multiple Aux's? In the mixer there is really only enough room in there to add like 1 more Aux strip, if I want to add more than that I need to re-arrange the entire global mixer which seems like a crazy system, surely there must be a more convenient method for getting muti-channel audio instruments set up quicker.
    Any help you can assist with would be exceptional!
    Thanks in advance.

    Not sure what exactly your question is, especially since I don't use battery. But as far as creating aux tracks:
    • go to the audio layer of the environment (not the track mixer window), find the two defalt aux tracks
    • Highlight all tracks to the right of the aux tracks (these should be bus and output tracks), and drag to the right far enough to fit in a bunch of aux tracks; you might even want to drag the all underneath the aux tracks, if your screen accomodates
    • use the key command shift-command-a multiples times to create several new "audio objects", and double click each one to expand
    • highlight all the new objects and select options/clean up/ align objects (makes it look nicer)
    • still highlighted, over in the parameters section (left side) select a channel, setting it to the highest number aux (at this point, probably "aux 3")
    • now individual set the channel for each aux track – you'll see that now you have available "aux 4"; next time you set a successive track you'll see "aux 5" and so on
    • once you've got things set up the way you want, save it as a template so you don't have to do this again later

Maybe you are looking for

  • Error in Sun One AppServ 7 when debug app in Eclipse

    Hi, I'm using Sun One 7 App Server 7 - 2004Q2UR2 and Win 2000 pro. I'm starting my app in Debug mode, connecting the Eclipse 3.0.1 debug to the server and when running the app the server shutdown! someone give me a light! Tks

  • Using a Visitor Pattern to apply the Law of Demeter?

    I don't understand how to use Law of Demeter (LoD) with hierarchical classes and the Visitor Pattern. The hierarchy of classes is for example (with relationships): Article [m:m] Supplier [m:1] Address. If I want to set the address, I would normally h

  • How to get standalone Oracle HTTP Server with mod_plsql?

    Hi, I do not know if it is just me but it seems to be a nightmare to get OHS with mod_plsql from the official OTN download site. I downoaded the companion CD for Windows - 3 disks, installed OHS - no mod_plsql. Then I tried to find any clue on OTN on

  • Print a list of files and folders

    Dose anyone know an easy way of listing files and folders from a disk? I need an inventory of the names on some ZIP disks.

  • Can I run any .swf file on iphone using AIR SDK 2.6?

    Hi, Can I make any .swf file runnable on iphone/ipad using AIR SDK 2.6? If yes then how? If not then why? And if I can not run each .swf file on apple devices then what type of .swf file I can run on these devices? Thanks, Sampada