json array

188 views
Skip to first unread message

SuN

unread,
Jan 22, 2008, 2:45:55 AM1/22/08
to json-taglib
i am using spring frame work with jsp.

<%@ taglib prefix="json" uri="http://www.atg.com/taglibs/json" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
<json:object>
<json:property name="identifier" value="${sandbox.name}"/>
<json:property name="label" ><c:out value="${sandbox.size}"/>
<json:array name="childrens" var="child" items="$
{sandbox.children}">
<json:object>
<json:property name="name" ><c:out value="${child.name}"/></
json:property>
<json:property name="type" value="folder"></json:property>
</json:object>
</json:array>
</json:object>

i am getting error as
javax.servlet.jsp.JspException: An error occurred while evaluating
custom action attribute "value" with value "${item.fileName}": Unable
to find a value for "fileName" in object of class "java.lang.String"
using operator "." (null).

Daniel Henriquez

unread,
Jan 22, 2008, 8:35:20 AM1/22/08
to json-...@googlegroups.com
Hi
in this section ....
<json:array name="childrens" var="child" items="${sandbox.children}">
 
children is a attribute of sandox and must be an array or iterable object
 
Sls

Jeremy Sears

unread,
Jan 22, 2008, 1:45:23 PM1/22/08
to json-...@googlegroups.com
I think the problem is outside of the JSON example you posted. In
some JSP, you are evaluating the following EL: ${item.fileName}.
Wherever you are doing that, the "item" variable is not an object with
a property named "fileName". Instead, the "item" variable references
an instance of a String. It's likely that you initialized the "item"
variable with a value that is a string literal, rather than a
reference an object that includes that property.
--
Jeremy Sears

On Jan 22, 2008 2:45 AM, SuN <sunda...@gmail.com> wrote:
>

Reply all
Reply to author
Forward
0 new messages