How I can restart tomcat and refresh Page
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.
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.
But I am writting code in JSP.
Can u give me sample code for that then I get exact idea.
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...
also I think you would want to....(if your not already) when you use<FORM>, the you use METHOD=POST not METHOD=GET.
<META HTTP-EQUIV = "pragma" CONTENT="no-cache">
also to refresh by the browser you can use. This one I use a lot.
Well I hope some of this helped.
<meta http-equiv="refresh" content="1;url=http://www.yoursite.com">
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)