You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Thai Thanh Ha <th...@psv.com.vn> on 2001/03/07 10:43:35 UTC
Problem with using tag
I want to use <logic:equal> with a boolean attribute of a bean. But I
always received error:
--------------
Exception Report:
javax.servlet.ServletException: No bean found under attribute key
currentSupplier
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:481)
at
_0002fsuppliers_0002ejspsuppliers_jsp_0._jspService(_0002fsuppliers_0002ejsp
suppliers_jsp_0.java:272)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
.....
Root Cause:
javax.servlet.jsp.JspException: No bean found under attribute key
currentSupplier
at
org.apache.struts.taglib.template.InsertTag.doEndTag(InsertTag.java:131)
at
_0002fsuppliers_0002ejspsuppliers_jsp_0._jspService(_0002fsuppliers_0002ejsp
suppliers_jsp_0.java:258)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
.......
-------------
This is my JSP page:
<logic:iterate id="currentSupplier"
name="ViewSuppliersAction.suppliers" scope="request">
...
<logic:equal name="currentSupplier" property="active"
scope="request" value="true">
<input type="checkbox" name="checkbox" checked>
</logic:equal>
<logic:equal name="currentSupplier" property="active"
scope="request" value="false">
<input type="checkbox" name="checkbox">
</logic:equal>
...
</logic:iterate>
-----------------
I don't know what's wrong. Maybe this tag can't handle boolean value? I
know that currentSupplier bean is valid (because <bean:message> tag can work
in the <logic:iterate> tag)
Please help me!
Regards,
Thai
Re: Problem with using tag
Posted by Dung Hoang <dq...@yahoo.com>.
Hello,
There's nothing wrong with the Struts logic handling the boolean value.
The problem is that you misunderstood the iterate syntax. Looking at the
thrown
exception, it seems that it couldn't find your bean.
In your code,
> <logic:iterate id="currentSupplier"
> name="ViewSuppliersAction.suppliers" scope="request">
since you left out the property attribute in the logic:iterate, Struts
will assume that your name attribute (ViewSuppliersAction.suppliers) is
a bean name. Try this:
<logic:iterate id="currentSupplier"
name="ViewSuppliersAction" property="suppliers" scope="request">
BTW, are you located in Vietnam? or at your headquarter in GA?...
just curious....
Happy Strutting
Du~ng
----- Original Message -----
From: "Thai Thanh Ha" <th...@psv.com.vn>
To: <st...@jakarta.apache.org>
Sent: Wednesday, March 07, 2001 4:43 AM
Subject: Problem with using <logic:equal> tag
>
> I want to use <logic:equal> with a boolean attribute of a bean. But I
> always received error:
>
> --------------
> Exception Report:
> javax.servlet.ServletException: No bean found under attribute key
> currentSupplier
> at
>
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
> l.java:481)
> at
>
_0002fsuppliers_0002ejspsuppliers_jsp_0._jspService(_0002fsuppliers_0002ejsp
> suppliers_jsp_0.java:272)
> at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
> .....
>
> Root Cause:
> javax.servlet.jsp.JspException: No bean found under attribute key
> currentSupplier
> at
> org.apache.struts.taglib.template.InsertTag.doEndTag(InsertTag.java:131)
> at
>
_0002fsuppliers_0002ejspsuppliers_jsp_0._jspService(_0002fsuppliers_0002ejsp
> suppliers_jsp_0.java:258)
> at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
> .......
> -------------
>
>
> This is my JSP page:
>
> <logic:iterate id="currentSupplier"
> name="ViewSuppliersAction.suppliers" scope="request">
> ...
> <logic:equal name="currentSupplier" property="active"
> scope="request" value="true">
> <input type="checkbox" name="checkbox" checked>
> </logic:equal>
>
> <logic:equal name="currentSupplier" property="active"
> scope="request" value="false">
> <input type="checkbox" name="checkbox">
> </logic:equal>
> ...
> </logic:iterate>
>
> -----------------
>
> I don't know what's wrong. Maybe this tag can't handle boolean value? I
> know that currentSupplier bean is valid (because <bean:message> tag can
work
> in the <logic:iterate> tag)
>
> Please help me!
>
> Regards,
> Thai
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com