91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

做這個東西居然花了不少時間,也折騰了不少時間——盡管這并不是一個復雜的東西。 環境:jdk1.8 tomcat8.5 mysql Eclipse 使用的是注解的方式完成的,因為注解的方式可以減少一些配置文件,比較方便的。 【特別強調】一定要清楚如何調試項目,因為自己的環境和下載的資源的環境可能不一樣,需要修改配置文件或是其他才能正常運行。https://blog.csdn.net/smileyan9/article/details/80522536

資源截圖

代碼片段和文件信息

package?cn.smileyan.action;

import?org.apache.struts2.convention.annotation.Action;
import?org.apache.struts2.convention.annotation.Namespace;
import?org.apache.struts2.convention.annotation.ParentPackage;
import?org.apache.struts2.convention.annotation.Result;
import?org.springframework.beans.factory.annotation.Autowired;
import?org.springframework.stereotype.Controller;

import?cn.smileyan.domain.User;
import?cn.smileyan.service.UserService;

import?com.opensymphony.xwork2.ActionSupport;
import?com.opensymphony.xwork2.ModelDriven;

@Namespace(“/“)
@ParentPackage(“struts-default“)
@Controller
public?class?UserAction?extends?ActionSupport?implements?ModelDriven?{
private?static?final?long?serialVersionUID?=?1L;
private?User?user?=?new?User();

public?User?getModel()?{
return?this.user;
}

@Autowired
private?UserService?userService;

@Action(value?=?“userAction_add“?results?=?{?@Result(name?=?“add“?location?=?“/success.jsp“)?})
public?String?add()?{
this.userService.saveUser(user);
return?“add“;
}
}

評論

共有 條評論