cancel
Showing results for 
Search instead for 
Did you mean: 

componentRequest object not accesible in JSP file

Former Member
0 Kudos

Hello,

I wrote a little class that inherits from AbstractPortalComponent. The doContent()-method looks like this:


IResource jspResource = request.getResource(IResource.JSP, "jsp/output.jsp");
response.include(request, jspResource);

In the JSP file "output.jsp", I'd like to use the componentRequest object, but I always get an error, when displaying the page. Therefore I think, there is no "componentRequest" object. The JSP file looks like this:


<%= componentRequest.getValue("testkey") %>

Do you have any suggestions?

Kind regards, Lars

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Lars,

Can you please tell us how you solved the problem? Can you paste here the code with all the required imports? I have the exact same problem and I wasn’t able to find any solution.

Thanks,

Cosmin

Former Member
0 Kudos

Hi Cosmin,

my reply might be a little too late, but if you still have the problem:

These are my imports in my JSP-file:


<%@ page import="com.sapportals.portal.prt.component.IPortalComponentURI" %>
<%@ page import="com.sapportals.portal.prt.component.IPortalComponentRequest" %>
<%@ page import="com.sapportals.portal.prt.pom.NodeMode" %>
<%@ page import="com.sapportals.portal.prt.event.IPortalRequestEvent" %>

To put something in the request, I used:


request.getNode().putValue("testkey", "testvalue");

To access the value inside the JSP again, I used the following code:


componentRequest.getNode().getValue("testkey");

I hope, that this might help you.

Kind regards, Lars

Message was edited by:

Lars Leibner

Former Member
0 Kudos

I just solved the problem by myself: I did forget ti import the required classes into the JSP file.

Regards, Lars