- Else tag body displayed when it shouldn't
 - commit a better fix, such that the changes lies in If.java, Else.java and ElseIf.java are rolled back to their original state.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@438176 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Toby Jee
2006-08-29 19:35:54 +00:00
parent a792db6c6f
commit e39b611cbf
3 changed files with 3 additions and 7 deletions
@@ -61,11 +61,9 @@ public class Else extends Component {
public boolean start(Writer writer) {
Map context = stack.getContext();
Boolean ifResult = (Boolean) context.get(If.ANSWER);
ifResult = ifResult == null ? Boolean.FALSE : ifResult;
context.remove(If.ANSWER);
//return !((ifResult == null) || (ifResult.booleanValue()));
return ! ifResult.booleanValue();
return !((ifResult == null) || (ifResult.booleanValue()));
}
}
@@ -67,10 +67,8 @@ public class ElseIf extends Component {
public boolean start(Writer writer) {
Boolean ifResult = (Boolean) stack.getContext().get(If.ANSWER);
ifResult = ifResult == null ? Boolean.FALSE : ifResult;
//if ((ifResult == null) || (ifResult.booleanValue())) {
if (ifResult.booleanValue()) {
if ((ifResult == null) || (ifResult.booleanValue())) {
return false;
}
@@ -84,7 +84,7 @@ public class If extends Component {
if (answer == null) {
answer = Boolean.FALSE;
}
stack.getContext().put(ANSWER, answer);
return answer.booleanValue();
}