made redirect property a Boolean to allow for a null value
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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")) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user