Hi Ajay,

Sorry, I didn't realise the problem had to do with checkboxes. I can offer 
a clue or two perhaps but you would be best off reading the struts doco on 
checkboxes. 

clue 1: checkbox values are stored as Strings.
clue 2: only selec ted checkbox values are submitted, not unselected ones.

you probably knew that already, hence my suggestion to read the struts 
doco.

Cheers, 

Heya Gosper
CSC Australia
212 Northbourne Ave, Braddon ACT 2612
Ph: +61 (0) 2 6246 8155  Fax: +61 (0) 2 62468100
MOB: 0401 611779
----------------------------------------------------------------------------------------
This is a PRIVATE message. If you are not the intended recipient, please 
delete without copying and kindly advise us by e-mail of the mistake in 
delivery. NOTE: Regardless of content, this e-mail shall not operate to 
bind CSC to any order or other contract unless pursuant to explicit 
written agreement or government initiative expressly permitting the use of 
e-mail for such purpose.
----------------------------------------------------------------------------------------





"ajay brar" <[EMAIL PROTECTED]>
22/12/2003 01:42 PM
Please respond to "Struts Users Mailing List"

 
        To:     [EMAIL PROTECTED]
        cc: 
        Subject:        Re: error:null property value please HELP


hi!

'functions' is the name of the tree structure in the form class, as

class SomeForm extends ActionForm
{ private TreeStructure functions;}

this form class also includes some String attributes. The whole display 
works fine, i have some text boxes for the String fields in the form, the 
tree structure gets displayed with the corresponding checkboxes. the 
problem 
arises when i select a particular checkbox and submit. thats when i get 
the 
error i mentioned earlier.
however if i just fill the text boxes and do not select and checkbox the 
form submits fine.

any clues?

thanks
Ajay


>From: [EMAIL PROTECTED]
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Subject: Re: error:null property value please HELP
>Date: Mon, 22 Dec 2003 13:28:17 +1100
>
>Hi Ajay
>
>I am doing something similar... I have a Tree class and a Node class to
>represent either branches or "leaves" of the tree.
>The Tree class has a field called treeRoot that represents the root Node.
>I ha ve an action that creates the tree and puts it on the request
>then in the JSP I have something like:
>
>         <%-- Loop through the array list of trees to display each root 
>node.
>            Note that 'myTree' was placed on the request by an Action 
--%>
>         <logic:present name="myTree">
>                 <nested:root name="currentTree">
>                         <nested:nest property="treeRoot">
>                                 <div class="root">
>                                         <jsp:include page="treenode.jsp" 

>/>
>                                 </div>
>                         </nested:nest>
>                 </nested:root>
>         </logic:present>
>
>Actually my jsp is slightly different because I can have multiple root
>nodes and I also iterate through each root node to display each tree. I
>have chopped those bits out to make the code more readable.
>
>So it seems that you are trying to reference a field "functions" that
>isn't declared in your tree class.
>
>Hope that helps.
>
>
>Heya Gosper
>CSC Australia
>212 Northbourne Ave, Braddon ACT 2612
>Ph: +61 (0) 2 6246 8155  Fax: +61 (0) 2 62468100
>MOB: 0401 611779
>----------------------------------------------------------------------------------------
>This is a PRIVATE message. If you are not the intended recipient, please
>delete without copying and kindly advise us by e-mail of the mistake in
>delivery. NOTE: Regardless of content, this e-mail shall not operate to
>bind CSC to any order or other contract unless pursuant to explicit
>written agreement or government initiative expressly permitting the use 
of
>e-mail for such purpose.
>----------------------------------------------------------------------------------------
>
>
>
>
>
>"ajay brar" <[EMAIL PROTECTED]>
>22/12/2003 12:55 PM
>Please respond to "Struts Users Mailing List"
>
>
>         To:     [EMAIL PROTECTED]
>         cc:
>         Subject:        error:null property value please HELP
>
>
>hi!
>
>i am getting an error when i submit a form.
>briefly i have a tree stucture that gets displayed, along with checkboxes
>to
>select a particular node. the tree structure is of the type:
>
>class TreeStructure{ private ArrayList children;}  //the ArrayList
>children
>contains objects of type
>
>//TreeStructure
>the structure includes a property 'selected' of type boolean.
>
>My ActionForm includes the tree as a property called 'functions'. i
>display
>them as
>
><html:form action="/saveUserConfig">
>       <nested:nest property="functions">
>                  <jsp:include page="treenode.jsp"/>
>       </nested:nest>
>       <html:submit value="Submit"/>
></html:form>
>
>//treenode.jsp is
><nested:root>
>                  <nested:checkbox property="selected" value="true"/>
>                  <nested:write property="nodeName"/><br>
>                 <nested:iterate property="children">
>                            <jsp:include page="treenode.jsp" />
>                 </nested:iterate>
></nested:root>
>
>the error i get is
>exception
>
>javax.servlet.ServletException: BeanUtils.populate
>  org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1254)
>
>org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)
>
>org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
>  org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
>  org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
>  javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
>  javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>
>
>root cause
>
>java.lang.IllegalArgumentException: Null property value for 'functions'
>
>org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:755)
>
>org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:801)
>  org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:796)
>  org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:729)
>  org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)
>
>org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)
>
>org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
>  org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
>  org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
>  javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
>  javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>
>
>please help
>thanks
>Ajay
>
>_________________________________________________________________
>Get less junk mail with ninemsn Premium. Click here
>http://ninemsn.com.au/premium/landing.asp
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>

_________________________________________________________________
Get less junk mail with ninemsn Premium. Click here 
http://ninemsn.com.au/premium/landing.asp


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



Reply via email to