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

  • 大小: 1.72MB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2023-10-24
  • 語言: 其他
  • 標(biāo)簽: SSH??源碼??

資源簡介

使用MyEclipse整合SSH(Struts、Spring、Hibernate)三大框架案例用戶注冊源碼下載

資源截圖

代碼片段和文件信息

package?com.beauxie.action;

import?javax.servlet.http.HttpServletRequest;

import?org.apache.struts2.ServletActionContext;
import?org.apache.struts2.convention.annotation.Action;
import?org.apache.struts2.convention.annotation.Namespace;
import?org.apache.struts2.convention.annotation.Result;
import?org.apache.struts2.convention.annotation.Results;
import?org.springframework.beans.factory.annotation.Autowired;
import?org.springframework.context.annotation.Scope;
import?org.springframework.stereotype.Controller;

import?com.beauxie.bean.User;
import?com.beauxie.service.UserService;

/**
?*?@author?Beauxie
?*
?*/
@Controller//用于標(biāo)注控制層組件
@Namespace(“/user“)//url前綴
@Scope(“prototype“)//Action默認(rèn)是單例,但實(shí)際開發(fā)中,一般是多例,因?yàn)橐话阋粋€Action可能會對應(yīng)多個不同的請求
//@ParentPackage(“struts-default“)//繼承特定的package,默認(rèn)是“struts-default”,因此可以省略不寫
@Results({
@Result(name=“registSuccess“l(fā)ocation=“/msg.jsp“)
})
public?class?UserAction?{

@Autowired//自動注入
private?UserService?service?;

//struts默認(rèn)攔截“.action以及不加任何后綴”
@Action(value=“regist“)//訪問:/user/regist.action?或??/user/regist
public?String?regist(){

??//獲取request
??HttpServletRequest?request?=?ServletActionContext.getRequest();
???
??//獲取表單提交的數(shù)據(jù)
??String?username?=??request.getParameter(“username“);
??String?password?=?request.getParameter(“password“);
??//封裝userBean
??User?user?=?new?User();
??user.setId(1000);
??user.setUsername(username);
??user.setPassword(password);
??
??//調(diào)用service層的方法,向數(shù)據(jù)庫中增加一條記錄
??service.addUser(user);
??
??//將提示信息存入request域中,用以前臺顯示
??request.setAttribute(“msg“?“恭喜您,注冊成功!
注冊名:“+username);
??
return?“registSuccess“;
}

}


?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2016-10-27?14:02??SSHDemo\
?????文件????????1962??2016-10-26?20:55??SSHDemo\.classpath
?????文件?????????414??2016-10-26?20:47??SSHDemo\.myhibernatedata
?????文件????????1540??2016-10-27?11:18??SSHDemo\.project
?????目錄???????????0??2016-10-26?20:39??SSHDemo\.settings\
?????文件?????????522??2016-10-26?20:09??SSHDemo\.settings\.jsdtscope
?????文件?????????145??2016-10-26?20:55??SSHDemo\.settings\com.genuitec.runtime.libraries.xml
?????文件?????????364??2016-10-26?20:09??SSHDemo\.settings\org.eclipse.jdt.core.prefs
?????文件?????????480??2016-10-26?20:09??SSHDemo\.settings\org.eclipse.wst.common.component
?????文件?????????481??2016-10-26?20:39??SSHDemo\.settings\org.eclipse.wst.common.project.facet.core.prefs.xml
?????文件?????????563??2016-10-26?20:47??SSHDemo\.settings\org.eclipse.wst.common.project.facet.core.xml
?????文件??????????49??2016-10-26?20:09??SSHDemo\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件???????????6??2016-10-26?20:09??SSHDemo\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????文件?????????425??2016-10-26?20:47??SSHDemo\.springBeans
?????目錄???????????0??2016-10-27?09:09??SSHDemo\src\
?????文件????????1923??2016-10-27?11:25??SSHDemo\src\applicationContext.xml
?????目錄???????????0??2016-10-26?20:10??SSHDemo\src\com\
?????目錄???????????0??2016-10-26?20:11??SSHDemo\src\com\beauxie\
?????目錄???????????0??2016-10-26?20:13??SSHDemo\src\com\beauxie\action\
?????文件????????1978??2016-10-27?12:57??SSHDemo\src\com\beauxie\action\UserAction.java
?????目錄???????????0??2016-10-26?20:13??SSHDemo\src\com\beauxie\bean\
?????文件?????????946??2016-10-27?10:24??SSHDemo\src\com\beauxie\bean\User.java
?????目錄???????????0??2016-10-26?20:13??SSHDemo\src\com\beauxie\dao\
?????文件?????????833??2016-10-27?10:32??SSHDemo\src\com\beauxie\dao\UserDao.java
?????目錄???????????0??2016-10-26?20:13??SSHDemo\src\com\beauxie\service\
?????文件?????????599??2016-10-27?10:37??SSHDemo\src\com\beauxie\service\UserService.java
?????文件????????2292??2016-10-27?09:47??SSHDemo\src\hibernateContext.xml
?????文件?????????200??2016-10-26?20:35??SSHDemo\src\struts.xml
?????文件??????????53??2016-10-27?14:01??SSHDemo\ssh搭建步驟---博客地址.txt
?????目錄???????????0??2016-10-27?10:45??SSHDemo\WebRoot\
?????文件????????1141??2016-10-27?12:01??SSHDemo\WebRoot\index.jsp
............此處省略24個文件信息

評論

共有 條評論