servlet and tomcat question

Discussion in 'Java' started by ryan, Oct 1, 2004.

  1. ryan

    ryan Guest

    whenever i deploy a new servlet with tomcat 4.1.30 and use a web.xml file, i
    find i have to do the following to view it:

    1. stop and restart tomcat
    2. close and open internet explorer.

    anyway to skip these steps? seems like tomcat caches my servlet?
     
    ryan, Oct 1, 2004
    #1
    1. Advertising

  2. ryan

    Will Hartung Guest

    "ryan" <> wrote in message
    news:...
    > whenever i deploy a new servlet with tomcat 4.1.30 and use a web.xml file,

    i
    > find i have to do the following to view it:
    >
    > 1. stop and restart tomcat
    > 2. close and open internet explorer.
    >
    > anyway to skip these steps? seems like tomcat caches my servlet?


    It does cache the servlet. It doesn't really check for changes at that
    level. Tomcat has some Ant tasks that will let you install, remove, and
    reload a web app in the running container. You can also use URLs to the
    Manger App, and maybe the Admin application. I've had problems with this
    (seems to be a problem with commons logging), and just restart Tomcat, but
    it may work for you.

    As for IE, I dunno. Should be able to simply Refresh and have your new
    changes show up once Tomcat is restarted.

    Regards,

    Will Hartung
    ()
     
    Will Hartung, Oct 1, 2004
    #2
    1. Advertising

  3. ryan

    Ryan Stewart Guest

    "ryan" <> wrote in message
    news:...
    > whenever i deploy a new servlet with tomcat 4.1.30 and use a web.xml file,

    i
    > find i have to do the following to view it:
    >
    > 1. stop and restart tomcat
    > 2. close and open internet explorer.
    >
    > anyway to skip these steps? seems like tomcat caches my servlet?
    >

    From http://www.moreservlets.com/Using-Tomcat-4.html:

    The next step is to tell Tomcat to check the modification dates of the class
    files of requested servlets and reload ones that have changed since they
    were loaded into the server's memory. This degrades performance in
    deployment situations, so is turned off by default. However, if you fail to
    turn it on for your development server, you'll have to restart the server
    every time you recompile a servlet that has already been loaded into the
    server's memory.

    To turn on servlet reloading, edit install_dir/conf/server.xml and add a
    DefaultContext subelement to the main Service element and supply true for
    the reloadable attribute. The easiest way to do this is to find the
    following comment:

    <!-- Define properties for each web application. This is only
    needed
    if you want to set non-default properties, or have web
    application
    document roots in places other than the virtual host's appBase
    directory. -->

    and insert the following line just below it:

    <DefaultContext reloadable="true"/>

    Be sure to make a backup copy of server.xml before making the above change.
     
    Ryan Stewart, Oct 2, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mladen Adamovic
    Replies:
    3
    Views:
    4,175
    Mladen Adamovic
    Nov 16, 2003
  2. Sean Clarke
    Replies:
    1
    Views:
    1,951
    Sudsy
    Jan 7, 2004
  3. circuit_breaker
    Replies:
    2
    Views:
    2,095
    Jack Jia
    Apr 4, 2004
  4. Doug McCann
    Replies:
    1
    Views:
    1,153
    William Brogden
    Aug 5, 2004
  5. Replies:
    0
    Views:
    892
Loading...

Share This Page