Skip to Content
Former Member
Apr 14, 2005 at 10:16 PM

getting data into a bean / sharing a bean with JSPs


Hi there,

I am using SAP NetWeaver Developer Studio 2.0.9 to develop a special iView (I do not have a PDK on my portal). This iView should present data in a tabular form, so I used HTMLB in a JSP to define a TableView.

Then I made a bean (simple Java class) that has a TableViewModel as a private member with according getter and setter methods

The Developer Studio wizard generated a JSPDynPage with a doProcessBeforeOutput() method that looked like this:

public void doProcessBeforeOutput() throws PageException {
  //Form myForm = this.getForm(); // get the form from DynPage
  RackDataBean myTableViewBean = new RackDataBean();
    setAttribute("myTableViewBean", myTableViewBean);
  // fill bean with data here

But how? My data does not come from an R/3 system or anything. It needs to be pushed in from the outside. The data does not have to be persistent, it is just for a little demo. So my idea was to probably have a JSP (maybe another one) taking it's request parameters and putting it into the bean. With a forced refresh of the iView the data should show up.

As a test, I tried to append this to the doProcessBeforeOutput() method:

  String event = ((IPortalComponentRequest)getRequest()).
  String date = ((IPortalComponentRequest)getRequest()).
  String time = ((IPortalComponentRequest)getRequest()).
  String sever = ((IPortalComponentRequest)getRequest()).
  String[][] str = {{event, date, time, severity}};
    new DefaultTableViewModel(str, RackDataBean.colnames));

But it does not work. The iView works fine and I see my table view with the right columns, but no data in it, so the JSP at least seems to be correct. What would be the right way to do this?



Message was edited by: Ingmar Frank