I believe the bean is not available at the scripting level.  Read the Bean Tag 
developers guide: 
http://jakarta.apache.org/struts/api/org/apache/struts/taglib/bean/package-summary.html#package_description

My advice is to use a scriptlet to get the bean.
<%
    FooBar fooBar = pageContext.getAttribute("fooBar");
%>

Then your code should work.

Steve
----- Original Message -----
From: Miriam Aguirre
Sent: Thursday, March 14, 2002 3:45 PM
To: '[EMAIL PROTECTED]'
Subject: bean define problems



Ok, after spending over a day on what seems to be a trivial task, I finally
have to ask!
bean define is not "defining" variables in the page scope the way i thought
it should

i have this in my jsp :

<bean:define id="fooBar" type= "com.ssa.core.servlets.ReportActionForm"
             name="reportForm" scope="request"/>

then somewhere further along :

<td><%=fooBar.getColumnDisplayName(columnName)%></td>

I get this error :
[14/Mar/2002 11:27:24:5] error: Exception: SERVLET-compile_failed: Failed
in compiling template: /NASApp/webapp/reportTemplate.jsp, javac error:
c:\iplanet\ias6\ias\APPS\modules\webapp\WEB-INF\compiled_jsp\jsp\APPS\webapp
\reportTemplate.java:480: Undefined variable or class name: fooBar
                  out.print(fooBar.getColumnDisplayName(columnName));


ReportActionForm is the type of ActionForm i use for the jsp :

<form-bean     name="reportForm"
                    type="com.ssa.core.servlets.ReportActionForm"/>

<action path="/report"
            type="com.ssa.core.servlets.ReportAction"
    name="reportForm"
    scope="request"
    input="/reportTemplate.jsp">
      <forward name="success" path="/reportTemplate.jsp" redirect="false"/>
    </action>


I also tried adding 'toScope="page"' and that seems to make struts barf
[basically the java file is never completely generated from the jsp]:

2002-03-14 11:49:29 - ERROR-the file '\reportTemplate.jsp' generated the
following general exception: java.lang.NullPointerException
[14/Mar/2002 11:49:30:5] error: Exception: SERVLET-compile_failed: Failed in
compiling template: /NASApp/webapp/reportTemplate.jsp, javac error:
c:\iplanet\ias6\ias\APPS\modules\webapp\WEB-INF\compiled_jsp\jsp\APPS\webapp
\reportTemplate.java:270: Invalid expression statement.
                    org.apache.stru
                              ^
c:\iplanet\ias6\ias\APPS\modules\webapp\WEB-INF\compiled_jsp\jsp\APPS\webapp
\reportTemplate.java:270: ';' expected.
                    org.apache.stru
                                   ^
c:\iplanet\ias6\ias\APPS\modules\webapp\WEB-INF\compiled_jsp\jsp\APPS\webapp
\reportTemplate.java:270: '}' expected.
                    org.apache.stru
                                   ^
3 errors


by the way, i'm using iplanet & struts 1.0.2 . What the hell is my
problem??

Thanks.
-Miriam

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to