I'm having trouble getting this started.. any help?

Yesterday I bought a book -- Head First JSP's and Servlets because I wanted to learn about java could be used in web development. However I pretty much ran into problems from the first page. I seemed to fix most of them, But now a program that I made following the book's step-by-step instructions, doesn't appear on my http://localhost:8080/, instead I get told that the requested resource is not available.
What the program does is very simply display the date on the webpage, like i sad I'm just beginning. btw, I'm using tomcat5.5 as my server software, also this problem is more about setting it up properly and not so much about programming. Okay so the book told me to make the directory like this: tomcat5.5 -> webapps -> ch1 -> WEB-INF -> classes and in the WEB-INF folder I put web.xml (which is at the bottom of this post) and in the classes folder I put Ch1Servlet.class(the java file for this is at the bottom). Now this is the part I don't get. The book tells me to go to http://localhost:8080/ch1/Serv1 even though there are no files/folders that have the name Serv1. So this didn't work, and a couple others like/ch1/WEB-INF/classes/Ch1Servlet.class and /ch1/WEB-INF/web.xml. I was up to 4:45 in the morning last night trying to fix this; any help would be GREATLY appreciated.
web.xml:
<?xml version="1.0" encoding="IISO-8851-1" ?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
     http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
     version="2.4">
     <servlet>
          <servlet-name>Chapter1 Servlet</servlet-name>
          <servlet-class>Ch1Servlet</servlet-class>
     </servlet>
     <servlet-mapping>
          <servlet-name>Chapter1 Servlet</servlet-name>
          <url-pattern>/Serv1</url-pattern>
     </servlet-mapping>
</web-app>Ch1Servlet.java
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class Ch1Servlet extends HttpServlet {
     public void doGet(HttpServletRequest request, HttpServletResponse response) {
          try {
               PrintWriter out = response.getWriter();
               java.util.Date today = new java.util.Date();
               out.println("<html>" + "<body>" + "<h1 align=center>HF\'s Chapter1 Servlet</h1>" + "<br>" + today + "</body>" + "</html>");
          } catch (IOException e) {
               System.exit(1);
}

asdfjava-er wrote:
The book that I'm using said it wasn't necessary for this because it's supposed to just make sure everything is working properly--which it's not.OK, if you want to ignore my advice, so be it, but please don't complain that it is not going to work without even trying it yourself.
asdfjava-er wrote:
Now this is the part I don't get. The book tells me to go to http://localhost:8080/ch1/Serv1 even though there are no files/folders that have the name Serv1.
Do you understand what the <servlet-mapping> declaration in the web.xml means? It is roughly just saying the appserver that it should port all requests on /Serv1 to the mentioned servlet.
a couple others like/ch1/WEB-INF/classes/Ch1Servlet.class and /ch1/WEB-INF/web.xml. The WEB-INF folder is not public accessible, so forget about that part.
"Resource not found" simply means that either the URL is wrong (case counts!) or that the resource is actually not there. I.e. not compiled, not deployed, not loaded, etcetera. Reading the appserver's startup logs might also help.

Similar Messages

  • I've got the labview vi written to read my IMU data from a serial port in COM1 and it displays onto the table on the front panel. I'm having trouble getting this data onto an excel spreadshee​t. Any ideas?

    I've got the labview vi written to read my IMU data from a serial port in COM1 and it displays onto the table on the front panel. I'm having trouble getting this data onto an excel spreadsheet. Any ideas? Right now my data will collect one reading instead of continuously reading my IMU which displays data in a continuous stream.
    Thanks
    Attachments:
    Read_IMU_Drew.vi ‏21 KB

    Hi
    Your vi is in 2009 version, which i am unable to open in 8.6
    However, if you want your data to be saved in excel sheet, here is the VI
    Somil Gautam
    Think Weird
    Attachments:
    save to excel.vi ‏12 KB

  • TS1424 i tunes is lock or on a disk i get this error any help?

    i get this error i tunes libary is lock can not access help?

    Glad things are working
    But be aware taht MacKeeper has a very bad reputation and it is recommended that you not use it at all
    https://discussions.apple.com/docs/DOC-3123
    LN

  • My HD video is having trouble unpausing...any help?

    I recently purchased Marvel's the Avengers in HD. Video quality is great. Sound is excellent, except for some explosions which sound scratchy. My real problem is this: When I attempt to play my video after pausing it, it doesn't respond; just flashes black a couple times for about 15-20 seconds, after which the video resumes. Not a monumental problem, but very annoying. Any help on this (and maybe the scratchy audio problem) would be greatly appreciated.
    P.S. I have a number of standard-definition movies on here as well. No audio/pausing problems on them. One of them is Inception, which has plenty of explosions; this makes me think my Avengers file might need replacing.

    My guess is a whole bunch of your apps are out of date.
    Pre-requisites: Make sure you have the latest iTunes software running on your computer.
    Try to perform a back and up restore:
    Plug your iPhone into a computer with iTunes and do a backup.
    http://support.apple.com/kb/ht5262
    Now once you've backed up, do a restore. Select restore from backup when it prompts for whether to set up as new phone or from backup.
    Now the last step is to update your iPhone:
    Most likely it would already ask you to update your iPhone once you've plugged it to iTunes. If not:
    http://support.apple.com/kb/ht4623
    Following the above steps should fix your iPhone.

  • Another device on the network is using your computer IP address.. Every time my macbook pro and my Imac are on line at the same time i get this message any help..??

    I have tried to turn off my modem and after that i turned on each machine individually it worked for a while giving my macbook pro and my Imac different IP address.. but the problem came back again and im here with 2 similar IP addresses on each machine and once that happen i lose the internet on both of them.. and I get an exclamation mark on my Airoport symbol.
    how can i change my IP address and where can i get a new 1.. should i just make it up..??
    TY

    sirioluce wrote:
    I have tried to turn off my modem and after that i turned on each machine individually it worked for a while giving my macbook pro and my Imac different IP address.. but the problem came back again and im here with 2 similar IP addresses on each machine and once that happen i lose the internet on both of them.. and I get an exclamation mark on my Airoport symbol.
    how can i change my IP address and where can i get a new 1.. should i just make it up..??
    TY
    What router are you using?

  • R6034 error having difficulty sorting this out any help please

    Hi I've just updated my iTunes as requested now getting error message

    Try the following user tip:
    Troubleshooting issues with iTunes for Windows updates

  • When I open my firefox browser my Jeeves is missing and am having trouble getting onto websites

    Can't see Jeeves on the opening browser page and I am having trouble getting onto websites any ideas.

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    See also:
    *[[/questions/860323]]
    IncrediMail Help Center: How do I remove IncrediMail MyStart from my Firefox Internet Browser?
    * http://help.incredimail.com/incredimail/help_center/help_article.aspx?article_id=276&lang_id=9

  • I have been having trouble getting my email on my iPad. It started when I brought it to the US on vacation (I live in London and my email provider is Virgin Media). It worked once since I returned, but that is it. I can send emails, but can't get them

    I have been having trouble getting my email on my iPad2.
    It started when I brought it to the US on vacation (I live in London and my email provider is Virgin Media). It worked once since I returned, but that is it.
    I can send emails, but can't get them.
    Any ideas, people?

    Hi Kharels
    Just posted this reply to 2 others with same sort of question:
    I have the same issue as i have my own email address and only want to use.
    There are two ways around this annoying problem. The first is to set up your own domain email account alongside your iCloud one, and when you go to send each email tap on From and you get a choice of emails addresses to reply from... ie your own domain or the iCloud one.  This is tedious though.
    The other is to set up your iCloud email as normal, then create a new one altogether. Choose 'Other' when creating this new account. Then put for the incoming server mail.me.com, along with your user name and password. For the outgoing server put the server you want to use - ie your own domain one. This is therefore a hybrid account and does work.
    Now switch off the email for iCloud (leaving on Calendar, Address Book etc). Switch on the email for your hybrid account (which of course is iCloud incoming as well).
    Providing you have directed your own domain email address to your me.com one, you will find the iPhone should behave itself and you can use the folders etc and these will synch with your Mac ok.
    Hope this work for you - let us know.
    Simon

  • I am having trouble getting a numbers spreadsheet to hold different formats in the same column.  A column with a date formatted heading will not convert to $ for the cells below.   Any suggestions would help.

    I am having trouble getting a numbers spreadsheet to hold different formats in the same column.  A column with a date formatted heading will not convert to $ for the cells below.   Any suggestions would help.

    Hi Wayne,
    Thank you for this response.  I have tried this but when I start enterring $ amounts some, such as $6.00, go in OK others such as $4.00 appear as a date ie 4 Oct 12.  
    Kind regards
    Paul

  • Hi, I am having trouble getting an album to download. I have tried it on both my iPhone and laptop through iTunes but neither works. I am wondering if it could be the size of the album stopping it downloading (212 Tracks) Any Ideas?

    Hi, I am having trouble getting an album to download. I have tried it on both my iPhone and laptop through iTunes but neither works. I am wondering if it could be the size of the album stopping it downloading (212 Tracks) Any Ideas?

    These alerts occur due to timeouts or conflicts trying to write a file during download.
    If you encounter this issue while while downloading something from the iTunes Store:
    Delete your iTunes Downloads folder, located in:
    Mac OS X:
  ~/Music/iTunes/iTunes Media/Downloads   Note: "iTunes Media" may appear as "iTunes Music. Also, the tilde (~)  refers to your Home directory.
    After locating your iTunes Downloads folder:
    Quit iTunes.
    Delete the Downloads folder on your computer.
    Open iTunes.
    Choose Store > Check for Available Downloads.
    Enter your account name and password.
    Also review this support aticle as it might be causing due to internet connection: http://support.apple.com/kb/ts1368
    Hope this helps.

  • Having trouble getting started with my new shuffle

    I am having trouble getting started with my new shuffle. any help?

    Hey there Feisty59,
    It sounds like you have a new iPod Shuffle, and want to know how to start using it. Here is a great resource for understanding how to use your iPod, and how to set it up and get music synced to it from iTunes:
    iPod shuffle User Guide
    http://manuals.info.apple.com/MANUALS/1000/MA1550/en_US/iPod_shuffle_4thgen_User _Guide.pdf
    If you have a different model of iPod Shuffle, choose yours from the following page and use that guide instead:
    Apple - Support - Manuals
    http://support.apple.com/manuals/#ipodshuffle
    Thank you for using Apple Support Communities.
    All the very best,
    Sterling

  • I am having trouble getting my Blutooth Magic Trackpad to work in windows 7 running through a bootcamp partition on my 2008 MacPro.  Any ideas?

    I am having trouble getting my Blutooth Magic Trackpad to work in windows 7 running through a bootcamp partition on my 2008 MacPro.  Any ideas?

    I installed the apple drivers and it works though unlike
    in osx where it works from the start in windows I need to click it once before it begin to work

  • HT4009 having trouble getting purchases for candy crush from the iTunes Store, any suggestions ?

    I am having trouble getting purchases for candy crush from the iTunes Store, any suggestions ?

    The problems being ? Does the 'buy' button not work, do you get any error messages ... ?
    If you are getting a message to contact iTunes Support then you can do so via this link and ask them for help (on these forums we won't know why the message is appearing) : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption
    If it's a different problem ... ?

  • I am having trouble getting mail from the server that my new iMac is connected to. I have to reboot the system to get Outlook for Mac to access the system. Any ideas?

    I am having trouble getting mail from the shaw server that my new iMac is connected to. I have to reboot the system to get Outlook for Mac to access the system and obtain new messages. Any ideas? Its at the point where I have started using the PC again as its less trouble.......

    In Firefox 3.6.4 and later the default connection settings have been changed to "Use the system proxy settings".<br />
    See "Firefox connection settings" in [[Server not found]]
    You can find the connection settings in "Tools > Options > Advanced : Network : Connection"<br />
    If you do not need to use a proxy to connect to internet then select No Proxy

  • HT3819 I bought a new computer and am having trouble getting my iTunes library onto it. any helpful suggestions

    I just bought a new computer and I am having trouble getting my iTunes library to transfer from the old computer to my new one. I turned the home sharing feature on but it still isn't working. Does anyone have any ideas or suggestions as to what I may be missing?

    See this migrate iTunes library post.
    tt2

Maybe you are looking for

  • Can any one believe this tech support trying to delete legacy adobe apps!!!!!!

    Vipin: May I have your permission to connect to your computer remotely and try to solve the problem while you watch? ADOBE CUSTOMER: I need to know that NONE of my legacy adobe apps will be affected. CS5 suite and CS6 products will NOT be affected is

  • Ap_selected_invoices_all Payment_Priority

    Hi All, I am selecting payment_priority and one more column for check printing from table ap_selected_invoices_all. However this table does not return any record when I am paying single invoice thorugh Quick Pay. Please tell me which tables are popul

  • What external read / write DVD drive is best for imac

    I have just bought a 27" iMac computer that is not fitted with a DVD read write external drive. Any advice on what I should buy?

  • Select path with same swatch and apply a new swatch

    I am trying to write a script that will select a line based on a swatch name, apply a new swatch, set the stroke, dash and miter of the line...and then create a new layer, change then name of the layer, and then move the selected items to the newly c

  • Updation of Organizational name changes in Business Partner

    Hi group, I need one clarification from anyone of you.It is regarding the updation of the Organizational changes made in "maintain Organization" (PPOMA_CRM) transaction (in Basic Data tab)in Business Partner (BP) transaction. For some organizations,