From: Ales J. <ale...@ge...> - 2006-07-09 13:18:51
|
User: alesj Date: 06/07/09 09:18:50 Modified: src/test/org/jboss/tutorial/web AppController.java Log: Reformat code + Spring-MC fix. Revision Changes Path 1.3 +20 -10 jboss-spring/src/test/org/jboss/tutorial/web/AppController.java (In the diff below, changes in quantity of whitespace are not shown.) Index: AppController.java =================================================================== RCS file: /cvsroot/jboss/jboss-spring/src/test/org/jboss/tutorial/web/AppController.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -b -r1.2 -r1.3 --- AppController.java 29 Oct 2005 23:58:12 -0000 1.2 +++ AppController.java 9 Jul 2006 13:18:50 -0000 1.3 @@ -34,44 +34,54 @@ /** * @author <a href="mailto:ale...@ge...">Ales Justin</a> */ -public class AppController extends MultiActionController { +public class AppController extends MultiActionController +{ private Randomizer randomizer; private Horoscope horoscope; - public Randomizer getRandomizer() { + public Randomizer getRandomizer() + { return randomizer; } - public void setRandomizer(Randomizer randomizer) { + public void setRandomizer(Randomizer randomizer) + { this.randomizer = randomizer; } - public Horoscope getHoroscope() { + public Horoscope getHoroscope() + { return horoscope; } - public void setHoroscope(Horoscope horoscope) { + public void setHoroscope(Horoscope horoscope) + { this.horoscope = horoscope; } public ModelAndView numberHandler(HttpServletRequest request, HttpServletResponse response) - throws Exception { + throws Exception + { int radius = RequestUtils.getRequiredIntParameter(request, "radius"); return new ModelAndView("main", "number", randomizer.getNumber(radius)); } public ModelAndView wordHandler(HttpServletRequest request, HttpServletResponse response) - throws Exception { + throws Exception + { return new ModelAndView("main", "word", randomizer.getWord()); } public ModelAndView horoscopeHandler(HttpServletRequest request, HttpServletResponse response) - throws Exception { - if (RequestUtils.getStringParameter(request, "clear") != null) { + throws Exception + { + if (RequestUtils.getStringParameter(request, "clear") != null) + { horoscope.clear(); return new ModelAndView("main"); - } else { + } else + { int month = RequestUtils.getRequiredIntParameter(request, "month"); return new ModelAndView("main", "horoscope", horoscope.getHoroscope(month)); } |