mirror of
https://github.com/apache/struts.git
synced 2026-08-07 23:57:03 +00:00
WW-1422
- 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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user