1 16 17 package com.google.inject.struts2.example; 18 19 import com.google.inject.Inject; 20 21 import static com.opensymphony.xwork2.Action.SUCCESS; 22 23 public class Count { 24 25 final Counter counter; 26 27 @Inject 28 public Count(Counter counter) { 29 this.counter = counter; 30 } 31 32 public String execute() { 33 return SUCCESS; 34 } 35 36 public int getCount() { 37 return counter.increment(); 38 } 39 } 40 | Popular Tags |