Last active
December 16, 2015 20:59
-
-
Save adilkurniaramdan/5496798 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//ExampleController.java | |
@Controller | |
public class ExampleController { | |
@RequestMapping(value = Routes.MTS.HOME, method = RequestMethod.GET) | |
public String home(ModelMap modelMap) { | |
modelMap.put("menu", "home"); | |
return Routes.MTS.VIEW_HOME; | |
} | |
@RequestMapping(value = Routes.SADARIAH.HOME, method = RequestMethod.GET) | |
public String home(ModelMap modelMap) { | |
modelMap.put("menu", Menu.Sadariah.HOME); | |
return Routes.SADARIAH.VIEW_HOME; | |
} | |
} | |
//-----------------------------------------------------------------------------------------------------// | |
//Routes.java | |
public interface Routes { | |
public static final String STRMTS = "/mts"; | |
public static final String VIEW_MTS="mts"; | |
public interface SADARIAH{ | |
public static final String HOME = "/home"; | |
public static final String VIEW_HOME = "home"; | |
public static final String LEGALITAS = "/legalitas"; | |
public static final String VIEW_LEGALITAS = "legalitas"; | |
//other are hidden | |
} | |
public interface MTS{ | |
public static final String HOME = STRMTS+"/home"; | |
public static final String VIEW_HOME = VIEW_MTS+"/home"; | |
public static final String LEGALITAS = STRMTS+"/legalitas"; | |
public static final String VIEW_LEGALITAS = VIEW_MTS+"/legalitas"; | |
//other are hidden | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment