cancel
Showing results for 
Search instead for 
Did you mean: 

Getting data from Jspdynpage to jsp in portal application

Former Member
0 Kudos

Hi Experts,

I have created a Portal application in which I am having a jspdynpage and jsp page. I need to send the value from jspdynpage into a variable in jsp page. Please provide me the following help.

Regards,

Nutan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

To pass data between JSPDynPage and JSP, you need bean class to be created with the JSpDynPage. If you haven't created that, create it using wizard again. Make sure you choose session or application scope for the bean. In the bean class, you can define variable, say name and generate setter and getter methods.

private String name = "";

Right click and choose generate getter and setter.

Then you can set value to this in JSpDynPage

IPortalComponentSession session = ((IPortalComponentRequest)this.getRequest()).getComponentSession();

Bean myBean = new Bean(); //assuming Bean is name of bean class with scope session

myBean.setName("Test");

session.putValue("Bean", myBean);

In JSP, you can get this value using

<jsp:useBean id="myBean" scope="session" class="com.test.Bean" />

<%=myBean.getName()%>

Regards,

Harini S

Answers (0)