GirlAction.java :  » Development » jodd » madvoc » girl » Java Open Source

Java Open Source » Development » jodd 
jodd » madvoc » girl » GirlAction.java
// Copyright (c) 2003-2007, Jodd Team (jodd.sf.net). All Rights Reserved.

package madvoc.girl;

import jodd.madvoc.meta.MadvocAction;
import jodd.madvoc.meta.In;
import jodd.madvoc.meta.Out;
import jodd.madvoc.meta.InterceptedBy;
import jodd.madvoc.interceptor.EchoInterceptor;
import jodd.madvoc.interceptor.DefaultMadvocInterceptors;
import jodd.petite.meta.PetiteInject;

import java.util.List;

@MadvocAction
@InterceptedBy({EchoInterceptor.class, DefaultMadvocInterceptors.class})
public class GirlAction {

  @PetiteInject
  GirlManager girlManager;

  @In
  Girl girl;

  public String add() {
    System.out.println("GirlAction.add");
    System.out.println(girlManager);
    girlManager.add(girl);
    prepare();
    return ".list.ok";
  }


  @Out
  List<Girl> girls;

  public String list() {
    System.out.println("GirlAction.list");
    System.out.println(girlManager);
    prepare();
    return "ok";
  }

  private void prepare() {
    girls = girlManager.getAllGirls();
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.