Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Tomcat Running Java Servlets from development Directory

Options
  • 07-04-2007 4:21am
    #1
    Registered Users Posts: 1,552 ✭✭✭


    Ok Im using Tomcat.
    I made a directory for to store my servlets in c which is c:/Servlets+JSP.

    How do I run the servlets stored in this directory?

    I know how to run the servlets I put in the root directory
    http://localhost:8080/servlet/theservletname.

    So what do I have to change in order to run the servlets in the
    c:/Servlets+JSP directory?


Comments

  • Registered Users Posts: 21,264 ✭✭✭✭Hobbes


    Create your servlet WAR file then go to this address (if you default installed).

    http://localhost:8080/manager/html/list

    go to "WAR file to deploy" and put in the location of your war file and it will be deployed to the server.

    If you mean physically move the directory. No idea sorry.


  • Registered Users Posts: 1,127 ✭✭✭smcelhinney


    You can also change the Context parameter in your server xml to point to that docbase (or appbase)

    This is a good article (although its specific to Tomcat 4.1, the same methodology applies)

    http://www.onjava.com/pub/a/onjava/2002/07/31/tomcat.html

    Be careful using the + sign though, if it appears in a server xml param it might try to treat it as a variable concatenation. Better off a) changing it, or b) encoding it.


Advertisement