Thank you for the reply.
1. I want to say yes, Feature is a proper JavaBean, with essentials
public class Feature {
private boolean premium;
public void setPremium(boolean b) { premium = b; }
public boolean isPremium(){ return premium; }
}
and no overloaded methods.
features is
On 15Nov, Mark Petrovic wrote:
c:when test=${feature.premium == true}
Should just be c:when test=${feature.premium}
Sorry. I failed to mention in my reply that I tried this, too, and it
made no difference in the html output.
Mark S Petrovic wrote:
which isn't even iterating over the list items. E.g, I get one line of
html output for the c:out value=${feature.premium}/ tag, containing
the string literal '${feature.premium}' in quotes - as if expansion of
${feature.premium} is not taking place.
You're using the
On 15Nov, Dave Newton wrote:
Mark S Petrovic wrote:
which isn't even iterating over the list items. E.g, I get one line of
html output for the c:out value=${feature.premium}/ tag, containing
the string literal '${feature.premium}' in quotes - as if expansion of
${feature.premium} is not
I know I'll look back on this learning curve with a head-slapping
recollection, but until then, for posterity:
1. If I remove the taglib directive in the JSP, the various c: tags
are copied directly into the html output, with the browser doing its
best to just ignore them. The plaintext tag
Mark S Petrovic wrote:
Whatever is misconfigured in my app is not a completely fatal situation:
I just can't get at the scripting variables to do meaningful operations
on them.
Can you set a String into scope:
request.setAttribute(foo, bar);
then in a JSP do:
c:out value=${foo}/
?
Dave
On 11/15/05, Mark S Petrovic [EMAIL PROTECTED] wrote:
I know I'll look back on this learning curve with a head-slapping
recollection, but until then, for posterity:
1. If I remove the taglib directive in the JSP, the various c: tags
are copied directly into the html output, with the browser
To: Struts Users Mailing List
Subject: Re: Newbie help with Struts idiom: functional if/else tags
I know I'll look back on this learning curve with a head-slapping
recollection, but until then, for posterity:
1. If I remove the taglib directive in the JSP, the various c: tags are
copied directly
Good day. I am new to Struts, and while I am coming up to speed, I'm
still struggling with what are surely common idioms.
In a JSP, I want to output, say, a td element body conditionally based
on a given bean property.
In pseudocode, I want
if bean.property == true
print td X /td
else
Use either Struts logic:equal or JSTL c:if or bare scriptlet. In
your particular case you can make the decision in the bean itself. Do
not print HTML tags from Java, this produces unmaintable and
unportable code.
Michael.
On 11/14/05, Mark S Petrovic [EMAIL PROTECTED] wrote:
Good day. I am new
On 11/14/05, Mark S Petrovic [EMAIL PROTECTED] wrote:
Good day. I am new to Struts, and while I am coming up to speed, I'm
still struggling with what are surely common idioms.
In a JSP, I want to output, say, a td element body conditionally based
on a given bean property.
In pseudocode, I
Thank you for the reply.
Using, for example, logic:equal seems to solve only half the problem.
Using logic:equal, I can see my way clear to
logic:equal name=feature property=premium value=true
tdTrue/a
/logic:equal
logic:notEqual name=feature property=premium value=true
tdTrue/a
I like this:
c:choose
c:when test=${bean.property}true/c:when
/c:choose
Larry
On 11/14/05, Michael Jouravlev [EMAIL PROTECTED] wrote:
Use either Struts logic:equal or JSTL c:if or bare scriptlet. In
your particular case you can make the decision in the bean itself. Do
not print HTML tags
I'm still stumbling on some details.
For
logic:iterate id=feature name=features
tr
td
c:choose
c:when test=${feature.premium == true}
c:out value=true/
/c:when
c:otherwise
c:out value=false/
On 11/14/05, Mark S Petrovic [EMAIL PROTECTED] wrote:
c:when test=${feature.premium == true}
Should just be c:when test=${feature.premium}
Is 'feature' a proper JavaBean? The types for get(is)/set methods
match, no overloaded set methods, etc?
--
Wendy
15 matches
Mail list logo