WebSphere Portal Server - Content of JSP not include in response for anonymous portal user

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > April 2004 > Content of JSP not include in response for anonymous portal user





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 Content of JSP not include in response for anonymous portal user
Marco Beelen

2004-04-11, 3:07 pm

Hello you all,


I have some wierd behaviour in my portal and hope somebody can explain
to me what goes wrong and how I might fix it.


I have written a simple portlet that sets an attribute on the request in
the doView()-method.
After that I dispatch the request to a jsp, which should render the
output and use the attribute.

doView() {
portletRequest.setAttribute( "specialtyOfTheWeek", thisWeeksSpecialty );
getPortletConfig().getContext().include( "/jsp/View.jsp",
portletRequest, portletResponse );
}

The weird behaviour is that the content of the jsp isn't included in the
response, not even if I remove all code from the jsp and only a simple
HTML-string remains.
I tried placing the code within a try-catch-block, but no Exceptions occur.
If a logged on user views the same portlet, then the content is rendered.

I don't think AccessRight cause the problem, because the portlet-title
is shown properly and while debugging the wierd behaviour I added a test
line to the doView behore the adding of the attribute.

doView() {
portletResponse.getWriter().print( "Can you see this line?");
portletRequest.setAttribute( "specialtyOfTheWeek", thisWeeksSpecialty );
getPortletConfig().getContext().include( "/jsp/View.jsp",
portletRequest, portletResponse );
}

That line was included in the response.

In the file: wps_2004.04.09-15.14.33.log the following error occurs:

2004.04.09 17:09:52.132 W
com.ibm.wps.pe.pc.legacy.impl.PortletRequestImpl getPortletSession
PEPC1017W: The Portlet Specialty of the Week 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.


I don't understand why this portlet tries to get a portlet-session for
such any simple operation as include a jsp-file.
If search with google and on the site ibm.com, but I couldn't get any
hits searching for: PEPC1017W. :-(

Environment:
IBM WebSphere Portal 5.0
Build Level: 144 2003-08-18 11:20

Running on: Windows 2000 Server, with DB2 8.1, IDS 5 and WAS 5


Any suggestions are greatly appreciated.

With kind regards,

Marco

__
Marco Beelen
Axxius B.V.
Weteringschans 100
marco.beelen@axxius.nl

Michael Yashin

2004-04-12, 3:33 am

Hi Marco,

All is OK

First of all you should set in your JSP:
<%@ page session="false" %>

Otherwise temporary sessions will be open for JSP's every time. (you
see it in the log file). This should help you.

PS. By default anonymous sessions are disabled in the portal. If you
need you can switch them on in that file:
\WebSphere\PortalServer\shared\app\confi
g\services\NavigatorService.properties
public.session = true

PS2. If you need portlet session you should get it using only
portletAdapter methods.

Regards,
Michael Yashin
Marco Beelen

2004-04-13, 4:34 am

Hi Micheal.

Many thanks, because your suggestion for the first line in the JSP did
solve my problem.

With kind regards,
Marco


Michael Yashin wrote:
> Hi Marco,
>
> All is OK
>
> First of all you should set in your JSP:
> <%@ page session="false" %>
>
> Otherwise temporary sessions will be open for JSP's every time. (you
> see it in the log file). This should help you.
>
> PS. By default anonymous sessions are disabled in the portal. If you
> need you can switch them on in that file:
> \WebSphere\PortalServer\shared\app\confi
g\services\NavigatorService.properties
> public.session = true
>
> PS2. If you need portlet session you should get it using only
> portletAdapter methods.
>
> Regards,
> Michael Yashin

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com