Dave Newton wrote:
--- [EMAIL PROTECTED] wrote:
<jsp:useBean id="accountBean"
type="billing.AccountBean"
scope="request"/>
I don't know exactly why I am using this, but from what I understand to
make the variable available for the page.
Being a newbie, I decided to try every single bit of info.
is sufficient, but it's still not clear to me why
you're using <jsp:useBean.../> at all.
<ui:dataGrid items="${accountBean.invoices}" [...]
If accountBean has an appropriate getInvoices() method
and whatever this taglib is you're using expects it, I
don't know (yet, anyway) what the problem would be.
Yes, it does have the correct getInvoices() here's the code:
public ArrayList<InvoiceBean> getInvoices() {
return invoices;
}
I don't see anything wrong with this !
Now How can I set a bean called invoices to the
value of the bean "account.invoices" ?
You have to say *what's actually happening* in order
for anybody to help you. You have to say what taglib
you're using so people that have used it can provide
input based on their prior experience. You should
probably answer my JSP 2.0 question, although that
depends somewhat on the taglib; it might not matter.
I am getting an exception in that taglib:
java.lang.IllegalArgumentException
at
org.apache.taglibs.datagrid.DataGridTag.setItems(DataGridTag.java:928)
at
org.apache.jsp.pages.accountView_jsp._jspx_meth_ui_005fdataGrid_005f0(accountView_jsp.java:273)
As I said: the StrutsRequestWrapper automagically
exposes OGNL stack values to JSTL; if your action has
a getAccountBean(), which it does, then
${accountBean.invoices} will get it under a JSP 2.0
container or a taglib that understands JSP EL
(assuming accountBean has a getInvoices()).
I think that where the problem is. I have debugged the and stepped
through the code of the taglib: here 's the method that's throwing the
exception in the Taglib
public void setItems (String value) throws JspException
{
Object obj;
obj = ExpressionLanguageHelper.evalObject ("items", value, this,
pageContext);
if (obj instanceof Iterator)
items = (Iterator) obj;
else if (obj instanceof Object [])
items = Arrays.asList ((Object []) obj).iterator ();
else if (obj instanceof Collection)
items = ((Collection) obj).iterator ();
else if (obj instanceof Map)
items = ((Map) obj).values ().iterator ();
else
throw (new IllegalArgumentException ());
}
when I stepped into the code, I found obj is of type string !!!!
So I assumed there's something wrong I am doing in passing the argument,
or setting some variable ... or....
Here's where my problem IS.
If you do a <c:forEach.../> over
${accountBean.invoices} does it work? Things like that
are helpful to know, especially when you are dealing
with a tag library that not everybody will have used.
Yes I tried forEach and it's working fine and giving me the expected
resulted. This code works as expected.
<c:forEach items="${accountBean.invoices}" var="inv" >
<c:out value="${inv.id}" />
</c:forEach>
If you're still getting the TLD error then your
problem is occuring before any of the above even
matters (I think!)
No I am not getting this error anymore.
Help us to help you.
I was frustrated when I posted the original message. I should have
included more details. Sorry and thank you.
d.
____________________________________________________________________________________
Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]