This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
Hi, I am trying to convert the following code (1) to (2) so that it will use displayTag for presentation. The logic:match tag inside the displayTag keeps complaining that it cannot find the property in the bean. The code(1) works. and code(2) works without logic:match tag. I need to use logic:match tag to compare the values and form (or not form) the links for the account. Does logic:match work with displayTag or am I missing anything in my code? Please help! (1) <bean efine id="acctlist" name="<%=InvestAction.getINVEST_ACCT_KEY()%>" scope="session" /> <logic:iterate id="acct" name="acctlist"> <tr class="even"> <logic:notMatch name="acct" property="gts" value="Y"> <td> <html:link href="ActDetail.do" paramId="acct" paramName="acct" paramProperty="acctNum"> <bean:write name="acct" property="acctNum" /> </html:link> </td> </logic:notMatch> <logic:match name="acct" property="gts" value="Y"> <td> <bean:write name="acct" property="acctNum" /> </td> </logic:match>
what do this code <%=InvestAction.getINVEST_ACCT_KEY()%> return to you, is it a bean, or only a property. As far as the code is concerned, it would work fine if this id="acctlist" holds a bean reference. Try to look into it probably your error lies there.
"Failure is not when you fall down; its only when you fail to get up again."
Joined: Jul 11, 2001
Thanks Shankar for the reply. It is the bean reference. As I said before code(1) works and it is correctly displaying links to acctNum if property 'gts' is anything other than 'Y'. I want that set of code work with display tag instead of struts logic:iterate tag. When I put logic:match, inside displayTag, it is giving the error(no property gts in the bean). I am using the same bean there too. Awaiting a reply Beksy
Joined: Jan 08, 2003
First of all let me tell you that i haven't used the display tag, anyway I found there are 2 places where the error might be lying.
This code might reference the bean defined by the name attribute, bcos it the way display tag works. If not your error lies here.
In this code the logic tag looks for an bean instance with the name you gave at the "name" attribute, but since you haven't defined any bean by this name, it is not able to find the property. Hope this takes into a new direction to solve your problem.