Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Render Method Called Twice
MANOVINAYAK AYYAPPAN, modified 12 Years ago.
Regular Member
Posts: 131
Join Date: 6/13/11
Recent Posts
Hi All,
I am facing this problem, for the first time.
Environment:
Liferay 6.0.6
There is only One Portlet placed in a portal page.
The portlet has a render method with one View.jsp.
The Problem:
The Render method is triggered twice when I hit the URL where the portlet is placed (say http://localhost:8080/listing).
Is this normal behaviour, or is something wrong with my implementation.
Please share your experience on this.
I am facing this problem, for the first time.
Environment:
Liferay 6.0.6
There is only One Portlet placed in a portal page.
The portlet has a render method with one View.jsp.
The Problem:
The Render method is triggered twice when I hit the URL where the portlet is placed (say http://localhost:8080/listing).
Is this normal behaviour, or is something wrong with my implementation.
Please share your experience on this.
Render method should be called once only. It only gets called at the time of showing the portlet.
Can you share your code snippet
Can you share your code snippet
MANOVINAYAK AYYAPPAN, modified 12 Years ago.
Regular Member
Posts: 131
Join Date: 6/13/11
Recent Posts
I developed a simple portlet with a render method, with the default view.jsp. Nothing much of code involved.
Inside the render method, I had put a test Log message to be displayed.
My Observation:
After deployment of the sample portlet, I found that every time I refreshed the page on which the portlet was placed, the log message appeared twice.
The page on which the portlet was placed, had a custom theme.
When I changed the Theme from Custom to Liferay Classic, I no longer found the issue; the log message appeared only once.
So with Custom theme, the render method gets called twice whereas with standard Classic Theme, it gets called only once.
I have only some JS and CSS included in the custom theme nothing else, wondering why this is happening.
Inside the render method, I had put a test Log message to be displayed.
My Observation:
After deployment of the sample portlet, I found that every time I refreshed the page on which the portlet was placed, the log message appeared twice.
The page on which the portlet was placed, had a custom theme.
When I changed the Theme from Custom to Liferay Classic, I no longer found the issue; the log message appeared only once.
So with Custom theme, the render method gets called twice whereas with standard Classic Theme, it gets called only once.
I have only some JS and CSS included in the custom theme nothing else, wondering why this is happening.
Are you using any custom layout ?
Try by deleting the page and re-create it and add your portlet on it.
Also verify by using any OOTB layout(if you are using custom one).
Try by deleting the page and re-create it and add your portlet on it.
Also verify by using any OOTB layout(if you are using custom one).
MANOVINAYAK AYYAPPAN, modified 12 Years ago.
Regular Member
Posts: 131
Join Date: 6/13/11
Recent Posts
Thanks !!
This happens independent of Portal Page.
I have tried creating a new Portal Page and as well as tried applying my theme to another existing page, the result is same.
And I am using Liferay's one column layout.
I am currently debugging the theme, hope I can find the problematic area.
This happens independent of Portal Page.
I have tried creating a new Portal Page and as well as tried applying my theme to another existing page, the result is same.
And I am using Liferay's one column layout.
I am currently debugging the theme, hope I can find the problematic area.
hi,
I am also facing same problem. My action mapping method is being called twice for single request. if i remove the custom theme it is working fine. how should resolve this issue. Please provide the solution if you find any.
I am also facing same problem. My action mapping method is being called twice for single request. if i remove the custom theme it is working fine. how should resolve this issue. Please provide the solution if you find any.
MANOVINAYAK AYYAPPAN, modified 12 Years ago.
Regular Member
Posts: 131
Join Date: 6/13/11
Recent Posts
Sorry for not updating this.
But I figured out that it was due to my Firefox browser.
I did not find this in other browsers.
I believe some of my Add Ons were causing some problem...
But I figured out that it was due to my Firefox browser.
I did not find this in other browsers.
I believe some of my Add Ons were causing some problem...
I am having the same problem in my portlets, and I it has this wrong behaviour on Chrome and Firefox, but works fine on IE. I need to support all browsers.
Have you reached the real cause of this problem?
Have you reached the real cause of this problem?
I have this problem too.And the doView function is same! Have the solution?
Same for me.... launching a single request and logging url + every originalServletRequest httpParameters (in my request method) I had:
An interesting behaviour is that, when I load the page, it gives me the first 4 rows.... but browser (Firefox/Chrome/Safari) is waiting for graphical resources (CSS,JS etc...)... after a bit of time it starts to render the page... so it raises the warning (404.jsp) and gives me the last logs (that is a new "request" call).
Do you have any news about?
PS: I use LR6.1.1
PPS: Yes... I confirm that this issue happens only using custom themes
12:08:16,780 INFO [http-bio-9090-exec-35][RenderPortlet:42] Rendering request... www.try.it/home
12:08:16,781 INFO [http-bio-9090-exec-35][RenderPortlet:60] -> /c/portal/layout
12:08:16,781 INFO [http-bio-9090-exec-35][RenderPortlet:64] -> p_l_id : 10431
12:08:16,782 INFO [http-bio-9090-exec-35][RenderPortlet:64] -> p_v_l_s_g_id : 0
12:08:22,665 WARN [http-bio-9090-exec-35][404_jsp:109] /html/css/taglib/@theme_image_path@/common/button_bg.png
12:08:22,708 INFO [http-bio-9090-exec-36][RenderPortlet:42] Rendering request... www.try.it/home
12:08:22,710 INFO [http-bio-9090-exec-36][RenderPortlet:60] -> /c/portal/layout
12:08:22,710 INFO [http-bio-9090-exec-36][RenderPortlet:64] -> p_l_id : 10431
12:08:22,711 INFO [http-bio-9090-exec-36][RenderPortlet:64] -> p_v_l_s_g_id : 0
An interesting behaviour is that, when I load the page, it gives me the first 4 rows.... but browser (Firefox/Chrome/Safari) is waiting for graphical resources (CSS,JS etc...)... after a bit of time it starts to render the page... so it raises the warning (404.jsp) and gives me the last logs (that is a new "request" call).
Do you have any news about?
PS: I use LR6.1.1
PPS: Yes... I confirm that this issue happens only using custom themes
There is an opened issue, unsolved at the moment: https://issues.liferay.com/browse/LPS-40984
Hi All,
I am facing a similar issue in "liferay-dxp-7.1.10-ga1".
In my code I have overridden default render of login portlet. I also have a custom theme deployed to my site. Please see the attached code snippet for more details
Issue : Render is getting invoked multiple(3) times.(Because I see repeated entries in my tomcat console log )
Please let me know if there is some issue with my custom module or if it is a known issue.
Thanks and Regards
Narsingh Pal
I am facing a similar issue in "liferay-dxp-7.1.10-ga1".
In my code I have overridden default render of login portlet. I also have a custom theme deployed to my site. Please see the attached code snippet for more details
Issue : Render is getting invoked multiple(3) times.(Because I see repeated entries in my tomcat console log )
Please let me know if there is some issue with my custom module or if it is a known issue.
Thanks and Regards
Narsingh Pal
Attachments:
Hey Narsingh ,Were you able to resolve this? I am having same issue on "liferay-dxp-7.1.10-ga1"Thanks
Wole
Wole
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™