on 03-13-2008 8:21 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.