i am working with struts framework 1.2. i have created a class by extending the class DispatchAction and defined some method therein. when i request from the browser some method are executing more than once.
actually i am printing hello in the method to debug the code and hello is printing 1-3 times randomely on requests for the method.
please give me some idea why this behaviour is coming. please tell me one more thing that when the object of this class will be created by the framework and where it is stored.
This is the code in IndexAction Class that is extending the class DispatchAction and in struts-config.xml i am mapping the home to index.jsp page as follows:
<forward name="home" path="/index.jsp" />
Now the process method actually do some database level tasks and store the information in a map that i am showing in index.jsp. this process method do processing which is based on some request parameter and it is showing unexpected behaviour like on different values for parameters showing different result.
for some values it is printing only one time for others two time and for some three time also.
one point also i want to tell is i have a hyperlink anchor tag in the jsp page that is referring to the same page with default values of parameter and if i am opening the page by clicking the link it is printing two times but when i am refreshing the browser window it is printing three times.
is there any difference between the requests send by clicking the hyperlink and refreshing the browser window with same url.
i am very surprised when i saw this type of behaviour. please help me on this.
i have found the problem actually the problem is not in the struts code because it is doing well with other browsers like ie and mozila. the problem is with google chrome actually it is creating problem by sending more than one request to the server.
now i am trying to findout why google chrome is behaving in different way.
thanks for your help.