Solved

How to use usebaen to connect to input data bean

Posted on 2007-03-21
1
339 Views
Last Modified: 2013-12-22
Hi Guys

I am trying to use a usebean tag to connect to a  input data bean

Here is my code
--------------------------------
<wcbase:useBean id="SRSDB" classname="com.srs.common.reporting.beans.SRSReportingDataBean">
<% SRSDB.setResourceBundle("com.srs.common.properties.SRSReportingMessages"); %>
<% SRSDB.setSqlQuery("CATALOG"); %>
<% String[] reportResult = SRSDB.getReportResultSet(); %>
</wcbase:useBean>
----------------------------------------------

somehow this gives me a null pointer exception error, but if I try scriptlet code to connect to a data bean it works. Would you giuys know what I am doing wrong in the usebean code, Thanks

-------------------------------------------

<% System.out.println("TEST Before");
SRSReportingDataBean reportingDb = new SRSReportingDataBean();
reportingDb.setSqlQuery("CATALOG");
reportingDb.setResourceBundle("com.srs.common.properties.SRSReportingMessages");//USER_RESOURCE_BUNDLE
com.ibm.commerce.beans.DataBeanManager.activate(reportingDb, request, response);
System.out.println("Test "+reportingDb.getReportResultSet()[0]);
String []reportResult=reportingDb.getReportResultSet();
%>
----------------------------------------------------
0
Comment
Question by:huzefaq
1 Comment
 
LVL 30

Accepted Solution

by:
Mayank S earned 500 total points
ID: 18767461
2 differences that I can see are that you set the query before setting the resource-bundle (though I doubt if that has a dependency) and that you call DataBeanManager.activate () before calling getReportResultSet.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
starter POM and spring-boot-starter,  spring-boot-web 2 58
HSSFWorkbook cannot be resolved error 10 72
Way to decrease size of apk file 9 72
hibernate example using maven 12 42
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question