Skip to Content
0
Former Member
Oct 05, 2006 at 02:00 PM

unable to get values from Jspdynpge class component to jsp

25 Views

hello,

I am using the jspdynpage model with out bean.I am retrieving the user info and i am trying to pass these values to jspdynpage using session object.I am not able to pass the values to jsp page.It tried doing that using context object too.it gives me error.And also how to pass the values in jsp to javascript.help me understand where I am going wrong.

Here is the code i am using:

package com.PS.BDS;

import com.sapportals.htmlb.*;

import com.sapportals.htmlb.enum.*;

import com.sapportals.htmlb.event.*;

import com.sapportals.htmlb.page.*;

import com.sap.security.api.IUser;

import com.sapportals.portal.htmlb.page.*;

import com.sapportals.portal.prt.component.*;

public class eg3_JspDyn extends PageProcessorComponent {

public DynPage getPage(){

return new eg3_JspDynDynPage();

}

public static class eg3_JspDynDynPage extends JSPDynPage{

public void doInitialization(){

}

public void doProcessAfterInput() throws PageException {

IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();

IPortalComponentResponse response;

IUser myUser = request.getUser();

//IUser myUser = userFactory.getUser(request.getUser().getUserId());

//String logonID = IPrincipal.getUniqueID();

String logonID = myUser.getUid();

String mail= myUser.getEmail();

//String lname =

//String firstname =

//String name = myUser.getUniqueName();

String city =myUser.getCity();

//response.write("User Id" + logonID);

request.getComponentSession().putValue("LogonID", logonID);

}

public void doProcessBeforeOutput() throws PageException {

this.setJspName("eg3_jsp.jsp");

}

}

}

Jsp:

<%

componentRequest.getComponentSession().getValue("myText").toString(); %>

<a href="javascript:SendEmail()">

<img src="C:\Documents and Settings\10095594\Desktop\eNewsletter.gif"

width="144" height="50">

</a>

<body><script type="text/javascript">

</script></body>

portalapp.xml

<?xml version="1.0" encoding="utf-8"?>

<application>

<application-config>

<property name="SharingReference" value="com.sap.portal.htmlb"/>

</application-config>

<components>

<component name="eg3_JspDyn">

<component-config>

<property name="ClassName" value="com.PS.BDS.eg3_JspDyn"/>

<property name="ComponentType" value="jsp"/>

<property

name="SecurityZone"

value="com.sap.pct.pdk/low_safety"/>

<property name="JSP" value="pagelet/eg3_jsp.jsp"/>

</component-config>

<component-profile/>

</component>

</components>

<services/>

</application>