[seam-dev] Replacing pages.xml

Gavin King gavin.king at gmail.com
Fri Feb 19 00:37:02 EST 2010


Oops, this is a MUCH better way to write this code:


   public enum MyAppPage implements Page<MyAppPage> {
	
      @View(.....)
      login {
         public MyAppPage next(MyAppPage page, Object outcome) {
            if (Boolean.TRUE.equals(outcome))
               return main;
             else
               return login;
    	}
      },

      @View(.....)
      main {
         public MyAppPage next(MyAppPage page, Object outcome) {
            return main;
         }
      },

      @View(.....)
      logout {
         public MyAppPage next(MyAppPage page, Object outcome) {
            return login;
         }
      };

   }


More information about the seam-dev mailing list