Results 1 to 13 of 13
Like Tree1Likes
  • 1 Post By DarrylBurke

Thread: run a servlet

  1. #1
    betty1500 is offline Member
    Join Date
    Feb 2012
    Posts
    8
    Rep Power
    0

    Default run a servlet

    i use the netbeans and want to run a servlet
    i get error messages:

    jpackage avax.servlet does not exist

    package javax.servlet.http does not exist

    how can i run the servlet i want a simple solution without using
    special server's

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,275
    Rep Power
    25

    Default Re: run a servlet

    Where is that package's class definitions? Is it in a jar file?
    Is that jar file on the classpath when you try to compile the program?

  3. #3
    betty1500 is offline Member
    Join Date
    Feb 2012
    Posts
    8
    Rep Power
    0

    Default Re: run a servlet

    there are some servlet files at :
    C:\Program Files\NetBeans 7.1\ide\modules\locale
    C:\Program Files\NetBeans 7.1\ide\modules\ext
    C:\Program Files\NetBeans 7.1\ide\modules
    C:\Program Files\NetBeans 7.1\ide\update_tracking
    C:\Program Files\NetBeans 7.1\ide\config\Modules

    2 are xml files the other are executable jar files

    i dont know what path is tuned in

  4. #4
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,275
    Rep Power
    25

    Default Re: run a servlet

    You need to do some research and find out:
    Where is that package's class definitions? Is it in a jar file?
    Is that jar file on the classpath when you try to compile/execute the program?

    Your last post does not answer any of those questions.

    how can i run the servlet i want a simple solution without using special server's
    A servlet runs inside of a server. It expects to be called from the server and will return control to the server.
    You do not run a servlet like a desktop app.

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,757
    Rep Power
    19

    Default Re: run a servlet

    If you want to run your servlet then you'll need a server to run it on.

    ETA: Phooey...

  6. #6
    betty1500 is offline Member
    Join Date
    Feb 2012
    Posts
    8
    Rep Power
    0

    Default Re: run a servlet

    the only way i know is to search for servlet so i did
    and gave the name of thejar files,should i extract them
    i dont know were to look for a path
    Last edited by betty1500; 02-22-2012 at 06:13 PM.

  7. #7
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,275
    Rep Power
    25

    Default Re: run a servlet

    If you have the jar file with the missing package, you need to have that jar file available to the compiler. If you use the javac command to compile your program you would use the -cp option to tell the compiler where to find the jar file.
    If you are using an IDE to do the compile, you will have to ask the IDE where to put the jar file so it can find it.

  8. #8
    betty1500 is offline Member
    Join Date
    Feb 2012
    Posts
    8
    Rep Power
    0

    Default Re: run a servlet

    how can i do so using netbeans?

  9. #9
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,275
    Rep Power
    25

    Default Re: run a servlet

    There is a section of this forum for IDEs. You could try asking there.

    http://www.java-forums.org/netbeans/

  10. #10
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,757
    Rep Power
    19

    Default Re: run a servlet

    Do you know anything about Java web apps?
    Because I suspect you ought to be going through a tutorial...
    Here's the JavaEE 6 one (I've linked directly to the Servlets bit).

  11. #11
    betty1500 is offline Member
    Join Date
    Feb 2012
    Posts
    8
    Rep Power
    0

    Default Re: run a servlet

    i know that i might use a server to run the program after compilation , what are the steps
    needed to launch a resin server ?

  12. #12
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,275
    Rep Power
    25

    Default Re: run a servlet

    There's a section of the forum for servlets:
    Java EE

  13. #13
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: run a servlet

    Re-posted in Java EE > Java Servlet
    running a servlet

    Closing this thread.

    db

    THREAD CLOSED
    Norm likes this.
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Passing Strin message from one servlet to another servlet
    By naveen516 in forum Advanced Java
    Replies: 0
    Last Post: 12-09-2011, 02:59 PM
  2. Replies: 1
    Last Post: 08-23-2011, 11:12 AM
  3. Replies: 1
    Last Post: 12-02-2008, 12:23 AM
  4. Replies: 1
    Last Post: 08-07-2007, 03:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •