i tried that too...i got this error..
javax.servlet.ServletException: bean abf  not found within scope 

sorry to bother you..

Nishit

-----Original Message-----
From: Natra, Uday [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 16, 2001 4:26 PM
To: '[EMAIL PROTECTED]'
Subject: RE: getting values from bean: newbie


Why don't U try

<bean:write name="abf" property="bookIsbn"/>

instead of 

<jsp:getProperty name="abf" property="bookIsbn"/>

Thanks,
Uday.

-----Original Message-----
From: Nishit Trivedi [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 16, 2001 3:27 PM
To: '[EMAIL PROTECTED]'
Subject: RE: getting values from bean: newbie


sorry...I tried to use <bean:define id="foo" name="bar" scope="session" />
but now it gives me NullPointer exception...

here is how i use <bean define/> tag...
---------------------------------
<bean:define id="abf" type="org.apache.struts.InSageLib.Library.AddBookForm"
scope="session" />
---------------------------------
and down the line i try to print this on screen:
---------------------------------
<jsp:getProperty name="abf" property="bookIsbn"/>
---------------------------------

I did not change tld file..
I digged out in work folder and its giving me error at this line: 
----------------------------
int _jspx_eval_bean_define_0 = _jspx_th_bean_define_0.doStartTag();
abf = (org.apache.struts.InSageLib.Library.AddBookForm)
pageContext.findAttribute("abf");
----------------------------

By the way, mainMenu.jsp in struts example uses <jsp:useBean>...

Nishit
-----Original Message-----
From: Natra, Uday [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 16, 2001 3:37 PM
To: '[EMAIL PROTECTED]'
Subject: RE: getting values from bean: newbie


I think U should use the <bean:define id="foo" name="bar" scope="session" />
tags to access the formBean instead of UseBean Tag.

Uday.

-----Original Message-----
From: Nishit Trivedi [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 16, 2001 2:32 PM
To: [EMAIL PROTECTED]
Subject: getting values from bean: newbie


hi..

I have a form through which i insert some data into DB...
I store all these form properties in a form bean...
When the form is submitted, DB insert is fine
But when i try to dislay the form properties on screen, it gives me
nothing...

I tried to follow struts example as far as the config file is concern....
here is some details that reveals some fact about my form:

In jsp file i have this:
---------------------------------------
<html:form action="/addBookForm" focus="bookIsbn">
<bean:message key="reqd.fields"/>
<table border="0" width="100%">
  <tr>
    <th align="right">
      <bean:message key="book.isbn"/>
    </th>
    <td align="left">
      <html:text property="bookIsbn" maxlength="300"/>
    </td>
  </tr>
---------------------------------------
here is my config file
---------------------------------------
    <form-bean      name="AddBookForm"
                    type="org.apache.struts.InSageLib.Library.AddBookForm"/>

---------------------------------------
and here is how I try to dislay properties:
---------------------------------------
<jsp:useBean id="abf" scope="session"
type="org.apache.struts.InSageLib.Library.AddBookForm" />
<%
  String isbnNumber = abf.getBookIsbn();
%>
<jsp:getProperty name="abf" property="bookIsbn"/>
---------------------------------------

I don't know what's the problem...??

Nishit Trivedi
Software Engineer
Planet Access Networks - An InSage Company
973-691-4704 X157

Reply via email to