Can't find the servlets package when compiling

Hi,
My problem is that when I compiling my servlets so can't the compiler find the two packages javax.servlet and javax.servlet.http.
Why?
Please can someone help me with this problem!
HelloServlet.java:2: package javax.servlet does not exist
import javax.servlet.*;
^
HelloServlet.java:3: package javax.servlet.http does not exist
import javax.servlet.http.*;

OK,
It seems like it will work with your proposal to. But now I have a new problem that you maybe can solve for me. That is when I try to test the following (from the book More Servlets and JavaServer Pages):
Test 3: A Servlet That Uses Packages and Utilities
The final servlet you should test to verify the configuration of your server and development environment is one that uses both packages and utility classes. HelloServlet3.java is a servlet in the moreservlets package that uses the ServletUtilities class to simplify the generation of the DOCTYPE (specifies the HTML version--useful when using HTML validators) and HEAD (specifies the title) portions of the HTML page. Those two parts of the page are useful (technically required, in fact), but are tedious to generate with servlet println statements.
Since both the servlet and the utility class are in the moreservlets package, they should go in the moreservlets directory. If you get compilation errors, go back and check your CLASSPATH settings--you most likely forgot to include the top-level development directory. I've said it before, but I'll say it again: your CLASSPATH must include the top-level directory of your package hierarchy before you can compile a packaged class that makes use of another class from the same package. This requirement is not particular to servlets; it is the way packages work on the Java platform in general. Nevertheless, many servlet developers are unaware of this fact, and it is one of the (perhaps the) most common errors beginning developers encounter.
Once you compile HelloServlet3.java (which will automatically cause ServletUtilities.java to be compiled), put HelloServlet3.class and ServletUtilities.class in install_dir/webapps/ROOT/WEB-INF/classes/moreservlets. Then, access the servlet with the URL http://localhost/servlet/moreservlets.HelloServlet3. You should get a simple HTML page that says "Hello (3)".
This works not for me! I will get this message when I try to compile HelloServlet3.java:
C:\Apache-Tomcat-4.1.27\ServletsDevel>javac HelloServlet3.java
HelloServlet3.java:23: cannot resolve symbol
symbol : variable ServletUtilities
location: class moreservlets.HelloServlet3
out.println(ServletUtilities.headWithTitle(title) +
^
1 error
Do you know what the problem is?

Similar Messages

  • I can't uninstall iTunes on my computer...it keeps telling me it can't find the installer package.  Any suggestions?

    I can't uninstall iTunes on my computer...it keeps telling me it can't find the installer package.  Any suggestions?  I have tried to delete all the iTunes components already, it didn't work.

    (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?

  • Where can I find the enhancement package version in my sap system

    Hi everybody,
        Can anyone tell me where can I find the enhancement package version information in my sap system?
    Thanks

    Hi Mike
         Thank you for your reply. But i can only find SAP BASIS7.1 under the Enterprise Services Repository in Tcode SPROXY.So could you tell where can I open SCV?
    Thanks

  • Where can i find the option of, when i close firefox that he saves my current tabs and when i open my firefox i will still have them?

    Where can i find the option of, when i close firefox that he saves my current tabs and when i open my firefox i will still have them?

    Firefox 4 and later versions save the previous session automatically, so there is no longer need for the dialog asking if you want to save the current session.<br />
    Use "File > Exit" or "Firefox > Exit" (Mac: "Firefox > Quit Firefox") if you want to restore multiple windows or otherwise have problems with restoring tabs.<br />
    You can use "History > Restore Previous Session" to get the previous session at any time.<br />
    You may need to click the orange/gray Firefox button to see History.<br />
    There is also a "Restore Previous Session" button on the default <b>about:home</b> Home page.
    Using the "Show my windows and tabs from last time" setting is a more reliable way to restore session data.
    * Tools > Options > General > Startup: "When Firefox Starts": "Show my windows and tabs from last time"
    * http://kb.mozillazine.org/Menu_differences
    Make sure that you do not use "Clear Recent History" to clear the 'Browsing History' when you close Firefox.
    * https://support.mozilla.org/kb/Clear+Recent+History

  • How can I find the detailed package message in jdev9i

    Usually in jdev9i we need the detailed interface,class message in package ,espically when it has something to do with oracle specialization. how can i find the exact message I need?

    sung:
    I mean the java doc. Langyun:
    Follow these steps:
    1. In JDev IDE's editor window, either type in or find the class whose JavaDoc you want to see. For example, you can go to the towards the top of a .java file and type "import oracle.jbo.Row;".
    2. Then, click on that String ("Row") and right-mouse click. You should see a menu item named "Browse JavaDoc". Select that menu.
    From there, you can go to the package level JavaDoc.
    Thanks.
    Sung

  • My LV program can't find the iak file when the program is loaded from a different PC.

    Hello all,
    My LV vi with Fieldpoint I/O and it's IAK file are stored on the company network.  If I load and run the LV vi from the PC it was developed on, everything is fine.  If I load and run on a different PC (that has an identical install of LV), the LV vi can't find the IAK file (all of the I/O pointers to the file are grayed out.) 
    Also, if I make an EXE out of the vi on the machine that can find the IAK, it won't find it if it's run from the other machine.
    It is not related to whether one machine has different "rights", as they are identical.  It's not related to different installs of LV, as they are identical.   
    I have found that this is related to the network login name/password, and to the machine's network name.  If I login on the second machine and try to run the program, it won't find the IAK.  If I point it to the IAK it will run.  If I save it and log out, and then login as a different user with the same rights on the second machine, it won't find the IAK again, until I re-point it there when I re-run it.  This is true for both the vi and the EXE.
    This problem makes deploying the EXE difficult to different machines, as the first time it's run, the EXE has to be pointed to the IAK.  Pointing the EXE to the IAK is difficult as these installations have no keyboard or mouse.
    Does anyone have any ideas on how to fix this so the LV vi or it's EXE finds the IAK from no matter where it's loaded from?
    Thanks,
    Mike

    Laura,
    I figured I'd continue this thread because it's along he same line..
    I have two Fieldpoint systems. They are identical, except for one thing...one has an AI-110 in position 7...the other has nothing. Both have the same IP address, etc and I swap the ethernet cable between them when I want to select which one I use.  I use a dedicated ethernet card to the FP processor...and it's not the company net.
    There are two IAK files...one for the system with the AI-110, one for the system without the AI-110. The two IAKs are in different paths.
    Before I had the system and the IAK without the AI-110, I made an EXE of the code that woked with the AI-110, and it worked fine.
    But now if I run the EXE after I've used MAX and opened the IAK without the AI-110, the EXE won't read the AI-110!  I have to go back into MAX and open the IAK that has the AI-110 in it, close MAX and restart the EXE for the EXE to see the AI-110.  (Max is NOT SET to "Download Items on Save")
    I looks like the EXE is looking at MAX to get the IAK or a pointer to the IAK.
    Did I build my EXE incorrectly?  Shouldn't an EXE completely ignore MAX once it's made?
    Thanks,
    Mike

  • I can't find the download manager when trying to download CS6

    I can't find the download manager.  I'm trying to download from a special adobe licensing site.

    Sorry, it's probably really easy to do, but I'm not sure how to change it. I have a Mac book. Can you help? It's strange that it seems to be the only tab missing, and only when I connect my iphone to sync, it doesn't happen when I sync my ipod. It's weird, and it never used to disappear. I need the photo tab back
    Sorry, and thanks to anyone that can help

  • Firefox can't find the file error when trying to download

    I am currently not having luck when clicking on the download button for each app...This is the error message I get,
    Firefox can't find the file at aam://SAPCode=AEFT?productVersion=12.0?passPhrase=Qx6qMfb9/oWx8agnabYz/ksL9vygzb30ZVZ6+4A KgbiDkQIEh1TTurmjLJXYoGHBdt97o64hQwef/EPa7zXT42z8iGzC7ZzUJWaBk1IID76maBwP1cEMXK0VB+DYo98sF gay7207mzeSwQIwGrMPLC+Ep78B13gEXvFdrr7Tg2I=.
    I'm running ML 10.8.4 on 2010 Macbook Pro.
    Thanks for any and all help.

    clear your adobe.com cookies and retry.

  • Tomcat can't find the servlets!

    Hi!
    I've just installed tomcat tomcat-5.5.16 with apache. Tomcat runs ok. It shows some samples (delivered with tomcat) under www.mywebsite.com/servlets-example and also www.mywebsite.com/jsp-examples. JSP files work perfectly, but when I try the servlets it can't find them:
    www.mywebsite.com/servlets-examples/servlet/RequestHeaderExample Object not found!my classpath lokks like this:
    /opt/SUNWappserver/jdk/lib:/opt/apache-tomcat/common/lib/servlet-api.jar:/opt/apache-tomcat/bin:/opt/apache-tomcat/webapps/servlets-examples/WEB-INF/classes:/opt/apache-tomcat/webapps/ROOT/WEB-INF/classesand web.xml looks like this:
        <servlet>
            <servlet-name>invoker</servlet-name>
            <servlet-class>
              org.apache.catalina.servlets.InvokerServlet
            </servlet-class>
            <init-param>
                <param-name>debug</param-name>
                <param-value>0</param-value>
            </init-param>
            <load-on-startup>2</load-on-startup>
        </servlet>and
        <!-- The mapping for the default servlet -->
        <servlet-mapping>
            <servlet-name>default</servlet-name>
            <url-pattern>/</url-pattern>
        </servlet-mapping>
        <!-- The mapping for the invoker servlet -->
        <servlet-mapping>
            <servlet-name>invoker</servlet-name>
            <url-pattern>/servlet/*</url-pattern>
        </servlet-mapping>I changed the web.xml und conf and under WEB-INF.
    I also changed server.xml to make tomcat work with apache on port 80.
    What did I do wrong? What did I forget?
    What is the difference between web.xml under conf and the ones under WEB-INF?
    Thanks for any help.

    opt/SUNWappserver/jdk/lib:/opt/apache-tomcat/common/lib/servlet-api.jar:/opt/apache-tomcat/bin:/opt/apache-tomcat/webapps/servlets-examples/WEB-INF/classes:/opt/apache-tomcat/webapps/ROOT/WEB-INF/classes
    May be ur classpath will be wrong try the classpath like this
    ;C:\Tomcat5\common\lib\servlet-api.jar;C:\Tomcat5\common\lib\jsp-api.jar;C:\Tomcat5\common\lib\log4j-1.2.9.jar;C:\Tomcat5\common\lib\mysql-connector-java-3.1.8-bin.jar;hello
    Check out all the enteries in the web-xml file and the path in the environment variable i your system.

  • Help - I can't find the "File" menu when I open iTunes

    I am trying to transfer a music file from my Mac to iTunes.  Directions state to click on the "File" menu when you open iTunes - but, seriously, I can't find a "File" menu item.  Help - I am tech challenged.  Thanks.

    You might need to bring up the menu bar to see the File menu.
    If you're using a version 11.0.x, click on the wee boxy icon up in the top-left corner of your iTunes to see the "Show Menu Bar" control, as per the following screenshot:

  • Where can I find the plugins folder when I have opened PSE13? I miss it in this version! If so why did Adobe removed it? Then this version has no use to me.

    I just purchased PSE13 and after installing I noticed that I can't find my plugins  while I could easily open it in my PSE11. Why did Adobe removed it???  If so I think I will install PSE11 again.
    Kind-a weird that this version doesn't have a plugin-use anymore.
    Oftwel: waar heeft PSE13 de plugins gelaten? In mijn vorige versie PSE11 wanneer ik met een foto bezig was kon ik mijn plugins bereiken, stonden ze er netjes bij maar bij deze versie kan ik ze nergens vinden. Mocht het zo zijn dat Adobe deze heeft verwijderd {wat erg dom is, naar mijn mening!} zit er niets anders voor me op om terug te gaan naar PSE11....

    I have Windows 7 Professional X86 and I also noticed that PSE13 was installed in my  'normal' program files folder instead of the X86 program files folder. PSE11 used the X86 programfiles folder. I dunno why though!

  • How can I find the servlet class name from inside a ServletFilter?

    Ive implemented a servlet filter, but need to discover the class name of any servlet class that gets executed.
    Ive dug through the spec and cant seem to find any path to do this.
    Seems the methods needed to do this have been deprecated. (for security reasons?)
    Is there any way to write a ServletFilter to grab this info?
    If not, is there any other way to capture every servlet execution in the container, time its execution, and log the class name along with the execution time?
    (***WITHOUT*** requiring a classpath over ride of any container provider classes)
    Any help is much appreciated. Been banging my head against this for some time now :(

    request.getServletPath() returns the part of the URL which refers to the servlet. It isn't the classname of the servlet but it should be a reasonable surrogate. If you log that, then you could write some code which reads your web.xml and uses the servlet-mapping elements to convert it to servlet class names later.

  • Acrobat 8 Professional can't find the scanning device when creating the second page of the PDF file

    Hey guys, this is my first post here, so please excuse me if there is anything I need to know.
    I am a Mac User and I have the whole CS3 suit installed.
    Everything works just great except there is this little thing bugs me around.
    When I try to use Acrobat Professional 8.0 to create a PDF file through my scanner, (samsung SCX-4725FN, it's scan/print/fax combined) I wouldn't be able to continue to scan to the second page. To be more specific, I have no problem to scan and create the first page of the PDF file, when it asks me if I want to scan and create another page, when I confirmed it, I wouldn't be able to see the scanner in the "Acrobat Scan" window. The "scan" botton stay faded, therefore I can't continue. If I click "cancel" and try to create another PDF file from the scanner, the smae problem will show up again. The only way that I can continue to scan is to quit the program from the menu bar and restart it, then I can start to create the next '1st page only' PDF file from the scanner. I had to do this rapidly to get all the pages scanned first, and then combine them to get my work done. This is a pain in the butt. I have downloaded the most updated scanner driver, and patched Acrobat to version 8.1.2 , but the problem still exist. I have tested the scanner with PS CS3, the scanner works just fine. So I assume there is a glitch here with the software. Can anyone help me please?

    I am not very clear at which step you are facing issue. Below is the sequence in order to scan more pages from Acrobat:
    1. Launch Acrobat. Click menu File->Create PDF->From Scanner....
    2. "Acrobat Scan" dialog will appear. Select your scanner installed in Scanner dropdown. Check 'Prompt for scanning more pages' checkbox as you want to scan more than one page. Click Scan button in "Acrobat Scan" dialog.
    3. Now scanner UI will appear. Make setting like color mode/resolution and click Scan button(or may be Accept button) in this dialog. (This is scanner specific ui)
    4. After this scanning will happen and "Acrobat Scan" dialog will appear with "Scan is Complete" and "Scan more pages" option.
    5. Select "Scan more pages" option and click OK in this dialog to scan more pages.
    6. Now again scanner UI will appear as in step 3 above. Make your settings and proceed.
    Do you see scanner UI or "Acrobat Scan" dialog in step6? Are you not able to click Scan(or Accept) button in scanner UI?

  • I have just purchased a macbook pro. I downloaded two sd cards, one via lightroom 4 and the other via iPhoto. I can't find the latter card when I try to import via LR4. In fact i can't find it at all unless i open iPhoto. where is it?

    Good Evening, I have just purchased a Macbook Pro, and have downloaded two SD cards of a trip to USA and Canada last September.  One via Lightrooom 4 and the other via iPhoto. I tried to import the SD card via iPhoto into Lightroom 4 but could not find it. I tried to find this "folder"? via other means with no success. however when I open iPhoto, there it is, so it must be on the Hard Drive somwhere??? I am new to Apple having decided to jump ship from Windows. Would be grateful for any help.

    iPhoto is a - like Lightroom - Photo Manager. It's a database. Like any db to get data out you have to export it.
    File -> Export
    and in this case set the Kind to Original.
    iPhoto is a $15 app, LR is somewhat more expensive. As they both want to manage the photos there's no good usage scenario where you use both. Pick one horse and ride, essentially.
    This User Tip
    https://discussions.apple.com/docs/DOC-4921
    has details of the options in the Export dialogue.

  • Where can I find the 'lock' sign when I enter a verified website. In prior versions, it used to show up on the status bar in the right bottom

    How can I verify in firefox 4 if the webpage I'm on is secured? in prior versions the 'lock' sign was popping up on the statusbar in the right bottom.

    I understand the reasoning behind removing this. I have worked in IT for 30 years, I like how this works in FF4. My concern, however, is that my 75 year-old parents do not, all they know is that for the last 10 years I have been telling them that if they don't see a padlock they should not enter any sensitive information. They will never click on the verification button, nor would they understand any of the information there anyway. In addition color coding the button does not help my color blind father nor my nearly-blind mother.
    I have been a huge proponent of FireFox since the original beta, but I will now begin telling all of my non-technical family and friends that come to me for IT advice to use a different browser, because I have neither the time nor the patience to retrain them.

Maybe you are looking for