Skip to Content
Former Member
Nov 11, 2005 at 02:53 PM

And again bean-data in JSPDynPage


Hi everybody,

as already read several times, I've got the same problem performing my first steps in EP content programming.

Within the jsp the bean is not present. When I define a non-default constructor for the bean, an exception is thrown, so the jsp tries to create a new instance, because it finds nothing in the session.

But where is my object?

Instead of session.(set|get)Attribute I also tried componentContext().(put|get)Value and an application scope. Didn't work either.

My DynPage:

  public static class Ralbi1stPageDynPage extends JSPDynPage{

    MyBean myBean_;

    public void doInitialization(){

    public void doProcessAfterInput() throws PageException {
      MyBean myBean = getMyBean();
      InputField input = (InputField)getComponentByName("inputName");
      if(input != null) {
        myBean.setTextView("Your name: "+input.getValueAsDataType().toString());
        myBean.setTextView("input not found.");

    public void doProcessBeforeOutput() throws PageException {
    public void onClick(Event event) throws PageException {
    private MyBean getMyBean() {
      IPortalComponentRequest request = (IPortalComponentRequest)this.getRequest();
      MyBean myBean = (MyBean)request.getServletRequest().getSession().getAttribute("myBean");
      if(myBean == null) {
        myBean_ = new MyBean();
        request.getServletRequest().getSession().setAttribute("myBean", myBean_);

        myBean = myBean_;
      return myBean;


<%@ taglib uri= "tagLib" prefix="hbj" %>
<jsp:useBean id="myBean" type="com.werum.ralbi.view.MyBean" scope="session"/>

<hbj:content id="myContext" >
  <hbj:page title="PageTitle">
   <hbj:form id="myFormId" >
    <hbj:tray id="example" design="BORDER" width="500" title="NameCheck" isCollapsed="false">
      <br/><font size="-1">Bean: <%=myBean%>/<%=myBean.getText()%>/<%=myBean.getTextView()%><br/></font>
      <hbj:inputField id="inputName" type="String" design="STANDARD" width="100" maxlength="100" tooltip="please enter your name">
      <hbj:button id="myButton" text="<%=myBean.getText()%>" onClick="click" tooltip="submit">
      <hbj:textView id="zeile1" encode="false" tooltip="your name">
       <% zeile1.setText(":"+myBean.getTextView()+":"); %>

My portalapp.xml:

<?xml version="1.0" encoding="utf-8"?>
<application alias="RalbiPortalApplication">
    <property name="PrivateSharingReference" value=""/>
    <component name="Ralbi1stPage">
        <property name="ClassName" value="com.werum.ralbi.Ralbi1stPage"/>
        <property name="SecurityZone" value="com.werum.ralbi.Ralbi1stPage/high_safety"/>
        <property name="ComponentType" value="jspnative"/>
        <property name="JSP" value="pagelet/Ralbi1stPage.jsp"/>
        <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>

I took the sample from a book, and had to change some details in order to get it run on Version 6.40 SP11.

These hints I got from this forum, but none of them helped to leave in success.

Kind Regards,