Hello, I've written a servlet which runs on my tomcat server. Using the get method on an html page I am able to load this servlet. The problem I have is this:
the doGet method of the servlet usually takes quite a while to complete. nothing wrong with this, i made it so as the program is fairly complex. so the issue for me now is finding a way to interrupt the execution of the doget() method from my html file. I want to do it using a html button or input tag (submit button or anything else). how do i go about it. thanks.
I feel you can't do it from the html page once a request is submitted we don't have any control on that REQUEST from the html page. It is running as thread inside the servlet. If you try to control from the html page, the request will be all new and it will be new thread again.
Actually what is the real output you want? Why do you need to interrupt from the html page?
You can control the thread in side doGet method anyway which should be coded in the doGet method itself.