-
-
Save kchien/e4182696645326949750 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WTF's added by me, class cut down for brevity. | |
public class ModelAndView { | |
// WTF?! | |
/** View instance or view name String */ | |
private Object view; | |
public ModelAndView(String viewName) { | |
this.view = viewName; | |
} | |
public ModelAndView(View view) { | |
this.view = view; | |
} | |
// WTF?! | |
/** | |
* Return the view name to be resolved by the DispatcherServlet | |
* via a ViewResolver, or <code>null</code> if we are using a View object. | |
*/ | |
public String getViewName() { | |
return (this.view instanceof String ? (String) this.view : null); | |
} | |
// WTF?! | |
/** | |
* Return the View object, or <code>null</code> if we are using a view name | |
* to be resolved by the DispatcherServlet via a ViewResolver. | |
*/ | |
public View getView() { | |
return (this.view instanceof View ? (View) this.view : null); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment