Controller class method getting called twice
Hi,
I have a JSP page on which I have a submit button. on clicking it I am submitting the form which re-directs the control to a Controller class which implements import org..web.servlet.mvc.Controller;
However on clicking the button the public ModelAndView handleRequest() method gets called twice. Now I am unable to locate the problem area : JSP page, Controller method or the Spring config files.
Please let me know if any of you have faced such issues.
thanks,
Abhijit
Hi ,
Even I am facing the same problem
I am setting ucl to be called in JS file,which in turn calls Controller handleRequest method,but this method is getting called twice..
Can any one suggest/comment on the issue.
Thanks,
Arun
Code:
However on clicking the button the public ModelAndView handleRequest() method gets called twice.
I would first try something like the quot;Live Headersquot; Firefox extension to see if you're posting to the same page twice. Does your HTML page have an onclick event on the submit button?
In my javascript I am setting ucl as:dojo.widget.byId(quot;abcCvrgquot;).setucl(quot;/abcCoverage.doquot;); which searchs for the ucl-pattern quot;/abcCoverage.doquot; in dispatcher-servlet.xml and invokes the corresponding controller method handleRequest and this method is called twice which i cud see in my log file. I have no clue about it..
Just general suggestions, since you haven't posted code. Apologies if you're already familiar enough with Spring/the web/debugging to have tried this stuff.
1gt; Generally speaking, unless you have really special requirements, subclassing Controller is not required. Spring has very many controllers that handle a lot of the request-response workflow for you. Is there a particular reason why you've chosen not to use one of the existing Spring classes (e.g. *FormController or *CommandController)?
2gt; I would suggest examining your server from access logs to see what the requests being made are.
3gt; I would suggest setting a debugger breakpoint in your method and seeing what the handleRequest method is doing when it's being called. I would suggest looking at the execution stack to see where it's being called from.
4gt; Does this occur if you remove Dojo from the equation?
If all these fail (and you've tried them all), I'd suggest posting back with your code and maybe we can help you out. cwilkes' suggestion is also good - there are many network monitoring tools out there that can watch from conversations - I would suggest trying one out.
Good luck! |