WebSphere Portal Server - Portlet Error : response is already committed

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > January 2004 > Portlet Error : response is already committed





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Portlet Error : response is already committed
Duchesne Christian

2004-01-19, 3:00 pm

Hi all,

i created a portlet and installed it on Portal Server 5.0
when i'm logged on portal, the portlet display jsp page, but for anonymous user, nothing is displayed and in the log i got the following message :

"The Portlet DarvaPortletJSP portlet tries to get a portlet session, but the response is already committed. Result: The portlet gets a temporary session that vanishes after this request. Values stored in the session are lost. Please use getPortletSession() in beginPage when the response is not yet committed."

it works fine when i display html page but not with jsp page.

Here the code of my doView() Method:

PortletData portletData = request.getData();
String pageJSP = null;
if (portletData.getAttribute("selectedJSP")== null) pageJSP=VIEW_JSP;
else pageJSP = (String)portletData.getAttribute("selectedJSP");
// Invoke the JSP to render
PortletConfig config = getPortletConfig();
PortletContext context = config.getContext();
context.include("/jsp/"+pageJSP, request, response);
Oliver Meyer

2004-01-19, 3:00 pm

I suspect, your JSP does not contain
<%@ page session="false" buffer="none".

If the JSP does not contain this entry, it creates a session when it is
called. This might explain why you code works when you use a HTML file.

Oliver
quote:

> Duchesne Christian wrote:
>
> Hi all,
>
> i created a portlet and installed it on Portal Server 5.0
> when i'm logged on portal, the portlet display jsp page, but for
> anonymous user, nothing is displayed and in the log i got the
> following message :
>
> "The Portlet DarvaPortletJSP portlet tries to get a portlet session,
> but the response is already committed. Result: The portlet gets a
> temporary session that vanishes after this request. Values stored in
> the session are lost. Please use getPortletSession() in beginPage when
> the response is not yet committed."
>
> it works fine when i display html page but not with jsp page.
>
> Here the code of my doView() Method:
>
> PortletData portletData = request.getData();
> String pageJSP = null;
> if (portletData.getAttribute("selectedJSP")== null) pageJSP=VIEW_JSP;
> else pageJSP = (String)portletData.getAttribute("selectedJSP");
> // Invoke the JSP to render
> PortletConfig config = getPortletConfig();
> PortletContext context = config.getContext();
> context.include("/jsp/"+pageJSP, request, response);


Duchesne Christian

2004-01-19, 3:00 pm

thanks a lot, it works fine now.
Christian

"Oliver Meyer" <meyer_oliver@gmx.de> a écrit dans le message de news:
3FB20E37.D7370C5A@gmx.de...[QUOTE][color=darkred]
> I suspect, your JSP does not contain
> <%@ page session="false" buffer="none".
>
> If the JSP does not contain this entry, it creates a session when it is
> called. This might explain why you code works when you use a HTML file.
>
> Oliver
>


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com