I was debugging my portlets on JBP today and found that my portlets sometimes get rendered twice.
The following is the only way to sort of overcome the problem.
When I am logged in as admin, the portlets definitely get rendered twice, and the strange thing is, the session ID is difference between the two rendering process. And it is consistent everytime when I refresh the portal page.
I have a debug line in my portlet, which outputs the session ID, everytime when I refresh the page, the debug line is outputed twice, with a different sessionID. The two sessionIDs are consistent within the session, meaning that if I get ID=1234 and ID=2222 from the debug lines, I will always get those unless session destoryed or timed out.
The worst thing is, sometimes even I have logged out, the portlet still rendered twice, but this time, the two session ID get outputed are identical.
How do I get rid of the rendering issue??
I met this problem when i am using spring portlet MVC.
It happened when I am using ParameterHandlerMapping and PortletModeParameterHandlerMapping at the same time. I think the reason is because the double definition, the spring dispatcher will dispatch the request twice.