made redirect property a Boolean to allow for a null value

This commit is contained in:
Scott Andrews
2008-03-03 17:07:18 +00:00
parent 83488a3355
commit 900f7a85ba
4 changed files with 6 additions and 6 deletions

View File

@@ -119,8 +119,8 @@ public class ViewState extends TransitionableState {
* Sets whether this view state should send a flow execution redirect when entered.
* @param redirect the redirect flag
*/
public void setRedirect(boolean redirect) {
this.redirect = Boolean.valueOf(redirect);
public void setRedirect(Boolean redirect) {
this.redirect = redirect;
}
public boolean getPopup() {

View File

@@ -80,7 +80,7 @@ public class FlowArtifactFactory {
* @return the fully initialized view state instance
*/
public State createViewState(String id, Flow flow, ViewVariable[] variables, Action[] entryActions,
ViewFactory viewFactory, boolean redirect, boolean popup, Action[] renderActions, Transition[] transitions,
ViewFactory viewFactory, Boolean redirect, boolean popup, Action[] renderActions, Transition[] transitions,
FlowExecutionExceptionHandler[] exceptionHandlers, Action[] exitActions, AttributeMap attributes) {
ViewState viewState = new ViewState(flow, id, viewFactory);
viewState.addVariables(variables);

View File

@@ -573,9 +573,9 @@ public class XmlFlowBuilder extends AbstractFlowBuilder implements ResourceHolde
private void parseAndAddViewState(Element element, Flow flow) {
ViewFactory viewFactory = parseViewFactory(element, false);
boolean redirect = false;
Boolean redirect = null;
if (element.hasAttribute("redirect")) {
redirect = ((Boolean) fromStringTo(Boolean.class).execute(element.getAttribute("redirect"))).booleanValue();
redirect = (Boolean) fromStringTo(Boolean.class).execute(element.getAttribute("redirect"));
}
boolean popup = false;
if (element.hasAttribute("popup")) {

View File

@@ -43,7 +43,7 @@ public class ViewStateTests extends TestCase {
Flow flow = new Flow("myFlow");
StubViewFactory viewFactory = new StubViewFactory();
ViewState state = new ViewState(flow, "viewState", viewFactory);
state.setRedirect(true);
state.setRedirect(Boolean.TRUE);
state.getTransitionSet().add(new Transition(on("submit"), to("finish")));
new EndState(flow, "finish");
MockRequestControlContext context = new MockRequestControlContext(flow);