Not sure where, but I remember reading that OGNL converts single characters in single quotes to the Character wrapper type, which may explain what you're seeing. In the first case "1" != '1' in Java since one is a String and one is a char, same is true here.
Was there anything in the logs about 3 & 7 throwing exceptions? That's the only reason I can think of that they wouldn't print. (*Chris*) On 9/19/07, Mark McLaren <[EMAIL PROTECTED]> wrote: > I hope someone can explain the following behaviour to me. Using the > S2 taglibs and OGNL is starting to confuse me somewhat. I have a test > JSP that I am accessing via the default ActionSupport class: > > <[EMAIL PROTECTED] uri="http://java.sun.com/jstl/core" prefix="c"%> > <[EMAIL PROTECTED] prefix="s" uri="/struts-tags" %> > > <ol> > <li><c:out value="${param.input == '1'}"/></li> > <li><c:out value='${param.input == "1"}'/></li> > <li><s:property value="#parameters.input[0] eq '1'" /></li> > <li><s:property value='#parameters.input[0] eq "1"' /></li> > <br /> > <li><c:out value="${param.input == 'a'}"/></li> > <li><c:out value='${param.input == "a"}'/></li> > <li><s:property value="#parameters.input[0] eq 'a'" /></li> > <li><s:property value='#parameters.input[0] eq "a"' /></li> > </ol> > > > If I call my page via "test.action?input=1". I get: > > 1. true > 2. true > 3. false > 4. true > > 5. false > 6. false > 7. false > 8. false > > Why is result 3 false? If I then call my page via > "test.action?input=a". I get: > > 1. false > 2. false > 3. > 4. false > > 5. true > 6. true > 7. > 8. true > > Why are the result of 3 and 7 results now blank? I have no idea what > is going on here, is this a bug? > > It seems to only happen when I'm evaluating against a single > character. I'm guessing it is some kind of char to String comparison > problem. It would feel very odd if I had to start using single quotes > around my taglib attributes (I usually need double quotes for > XML/XHTML attributes). > > Thanks, > > Mark > > -- > "Paradoxically, the more time saving abstractions you are using the > more you actually have to know." - Simon Willison > > --------------------------------------------------------------------- > 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]