It must be something about your portlet or configuration. I just tried it with one of my portlets and doView is called only once, even if the portlet is on a page by itself.
What version of JBoss Portal? What JVM? Could you post excerpts from the portlet-instances.xml and *-object.xml file, enough to identify the page, its portlet windows, and the corresponding instances.
Peter, thanks for trying to help.
I am using JBoss Portal 2.6.3GA bundled with AS 4.2.1
[ServerInfo] Java version: 1.6.0_03,Sun Microsystems Inc.
<deployments> <deployment> <instance> <instance-id>MyPortletInstance</instance-id> <portlet-ref>MyPortlet</portlet-ref> </instance> </deployment> </deployments>
<deployments> <deployment> <if-exists>overwrite</if-exists> <parent-ref>default.default</parent-ref> <window> <window-name>MyPortletWindow</window-name> <instance-ref>MyPortletInstance</instance-ref> <region>center</region> <height>1</height> </window> </deployment> </deployments>
I was using Portal 2.6.4 on AS 4.2.2. So I tried again with Portal 2.6.3 on AS 4.2.1. Still seeing only one call to doView.
You're using JDK 6. You like living dangerously. ;-) I was using JDK 5, tried with 6. Still only one call to doView.
And your configuration files are not much different from mine.
If I were you, what I would try next is adding this code at the start of the doView:
Exception eee = new Exception("called doView");
Then you can figure out where each of the calls to doView is coming from. That might give some insight as to why it is being called multiple times.
We have exactly the same problem on JDK 1.5 / JBoss Portal 2.6.4. It concerns only the portlets which are positionned on the default page.
I placed my portlet on the default page of the default portal, and on the default page of a new portal, and saw only one call. I still think the best bet is to look at the stack trace.
One more thought - what framework are you using for your portlet? Spring? Seam? JSF? Struts? My portlet was a simple hello portlet using only JSPs.
also simple jsp.
Jean, did you ever figure out what is causing the problem on your default page?
Is this happening with the default theme/layout, or with a customized one?
I've seen multiple renderings with a modified jboss-portal.sar/portal-core.war/layouts/generic/index.jsp, which included the following:
- a *.js file with 'document.write(".......");' calls
- references to images where the URL starts with '/portal/content/....' (which is intercepted by the CMS stack)
Have you ever found out what caused the multiple requests? I have the same problem: doView() is called 4 times although the portlet is only included one on the page.
What's more: i hacked into the LocaleInterceptor, which intercepts the HttpRequest and resets its locale-setting...it also gets called 4 times! JBoss Portal seems to make 4 requests out of one.
Found the reason for mutliple requests on http://www-01.ibm.com/support/docview.wss?uid=swg21242898.
Seems to be a general Portal issue and not JBoss-specific: if there is an -Tag on your page which links to a non-existing image, another page request is sent.
I found and corrected two such -Tags on my page and the number of requests was reduced by 2.
read "img-Tag" instead of "-Tag"...the forum stripped the html markup