???????????????????????Struts2??Spring??Java?????????д??????????Struts2Spring?????Action??Service??
???????????д??????Web???????????????????????δ????????????????"???????Struts2??Action????????? "????????????????
???????????????????????????????д???????У??????????????????
?????????????????????????-?????
????1.????????
????http://blog.csdn.net/fansunion/article/details/12118043  ???????Struts2??Action?????????
????????????????????????? ???JUnit????????????? Struts2?????????Action??
?????????????Struts2??Spring??2??????????????
????????????????????Demo???£?????????????? ???????????????
????2.???????????????jar????
????Struts???jar??
????Spring???jar??
????JUnit?? spring-test-3.2.3.RELEASE.jar??struts2-junit-plugin-2.2.3.1.jar????????jar??
????Tomcat??Servlet/JSP jar??
????3.???Action??
package action;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
/**
* ???????Action??
* @author FansUnion
*
*/
@Controller
public class UserAction {
@Autowired
private UserService userService;
public String getName() {
userService.getName("FansUnion");
return "success";
}
}