Content of JSP not include in response for anonymous portal user
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > WebSphere > WebSphere Portal Server > Content of JSP not include in response for anonymous portal user




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Content of JSP not include in response for anonymous portal user  
Marco Beelen


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-11-04 08: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






[ Post a follow-up to this message ]



    Re: Content of JSP not include in response for anonymous portal user  
Michael Yashin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-12-04 08: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.properti
es
public.session = true

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

Regards,
Michael Yashin





[ Post a follow-up to this message ]



    Re: Content of JSP not include in response for anonymous portal user  
Marco Beelen


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-13-04 09: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.proper
ties
> public.session = true
>
> PS2. If you need portlet session you should get it using only
> portletAdapter methods.
>
> Regards,
> Michael Yashin





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:25 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register