Results 1 to 4 of 4

Thread: How I can restart tomcat and refresh Page

  1. #1
    Join Date
    Jul 2008

    How I can restart tomcat and refresh Page

    Hello Friends,

    I am working upload xml form in my Java (JSP) application.
    In my upload JSP page when I upload xml file then file upload message come with restart button.
    When I click on that button (restart) we call one batch files which stop the tomcat and start tomcat. but in between on page throw the error "Connection Interepted" then we mannualy refresh the page it's working properly.

    MY problem is - I want refresh page automatically without showing error on page
    Please suggest me solution and other option which I can do efficently my upload with restar tomcat functionality.


  2. #2
    Join Date
    Aug 2005
    The Garden State
    you can do this by creating a servlet listener (specifically, a ServletContextListener), and catch the javax.servlet.ServletContextEvent in your contextDestroyed method. Though, it will take quite a bite of client side code.
    Acceptable Use | SQL Forum FAQ | celery is tasteless | twitter

    celery is tasteless - currently needing some UI time

  3. #3
    Join Date
    Jul 2008
    Thanks chazzy
    But I am writting code in JSP.
    Can u give me sample code for that then I get exact idea.

  4. #4
    Join Date
    Sep 2008
    Not sure what your JSP page looks like but here are some ideas for you to look at....might help might not.

    to auto refresh the page you could use a meta tag in the jsp page to instruct the browser not to store the page in the cache. That is...
    <META HTTP-EQUIV = "pragma" CONTENT="no-cache">
    also I think you would want to....(if your not already) when you use<FORM>, the you use METHOD=POST not METHOD=GET.

    also to refresh by the browser you can use. This one I use a lot.
        <meta http-equiv="refresh" content="1;url=http://www.yoursite.com">
    Well I hope some of this helped.

    Good Luck!
    Happy Code Writing!

    Think, think, think......just like pooh does!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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