@Test public void textIndex() { String result = ctxController.index(); assertNotNull(result); assertTrue(result.contains(CtxController.INTRO)); }
@RequestMapping("/") @ResponseBody public String index() { final StringBuilder sb = new StringBuilder("<html><body>"); sb.append(INTRO); String[] beanNames = ctx.getBeanDefinitionNames(); Arrays.sort(beanNames); for (String beanName : beanNames) { sb.append("</br>").append(beanName); } sb.append("</body></htm>"); return sb.toString(); }
CtxController { @RequestMapping("/") @ResponseBody public String index() { final StringBuilder sb = new StringBuilder("<html><body>"); sb.append(INTRO); String[] beanNames = ctx.getBeanDefinitionNames(); Arrays.sort(beanNames); for (String beanName : beanNames) { sb.append("</br>").append(beanName); } sb.append("</body></htm>"); return sb.toString(); } }
CtxController { @RequestMapping("/") @ResponseBody public String index() { final StringBuilder sb = new StringBuilder("<html><body>"); sb.append(INTRO); String[] beanNames = ctx.getBeanDefinitionNames(); Arrays.sort(beanNames); for (String beanName : beanNames) { sb.append("</br>").append(beanName); } sb.append("</body></htm>"); return sb.toString(); } @Autowired  CtxController(ApplicationContext ctx); }
CtxController { @RequestMapping("/") @ResponseBody public String index() { final StringBuilder sb = new StringBuilder("<html><body>"); sb.append(INTRO); String[] beanNames = ctx.getBeanDefinitionNames(); Arrays.sort(beanNames); for (String beanName : beanNames) { sb.append("</br>").append(beanName); } sb.append("</body></htm>"); return sb.toString(); } @Autowired  CtxController(ApplicationContext ctx); @RequestMapping("/") @ResponseBody String index(); @RequestMapping("/home") String home(ModelMap model); }
CtxController { @RequestMapping("/") @ResponseBody public String index() { final StringBuilder sb = new StringBuilder("<html><body>"); sb.append(INTRO); String[] beanNames = ctx.getBeanDefinitionNames(); Arrays.sort(beanNames); for (String beanName : beanNames) { sb.append("</br>").append(beanName); } sb.append("</body></htm>"); return sb.toString(); } @Autowired  CtxController(ApplicationContext ctx); @RequestMapping("/") @ResponseBody String index(); @RequestMapping("/home") String home(ModelMap model);  }