首页>代码>s2sh(spring+struts2+hibernate)开发民宿短租系统,也可作为酒店预订入住系统,系统后台都是可配置化,值得学习>/项目源码/hotel/src/com/hotel/action/LoginAction.java
package com.hotel.action;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import com.hotel.model.Item_cat;
import com.hotel.model.Room_cat;
import com.hotel.service.ItemCatService;
import com.hotel.service.RoomCatService;
import com.hotel.utils.Pager;
import com.opensymphony.xwork2.ActionContext;
@Controller("loginAction")
@Scope("prototype")
public class LoginAction {
@Autowired
private RoomCatService roomCatService;
@Autowired
private ItemCatService itemCatService;
//首页
public String index() {
Pager<Room_cat> pagers = roomCatService.listAll();
Pager<Item_cat> pager = itemCatService.listAll();
ActionContext.getContext().put("pager", pager);
ActionContext.getContext().put("pagers", pagers);
return "success";
}
//登陆页面
public String login() {
return "success";
}
//注册页面
public String register() {
return "success";
}
//退出
public String tuichu() {
ActionContext ac = ActionContext.getContext();
Map session = ac.getSession();
session.remove("userName");
session.remove("userId");
return "login";
}
}
最近下载更多
xiao小果 LV13
2024年8月27日
微信网友_6177587776049152 LV1
2023年4月23日
打野只抓上 LV2
2023年4月12日
彬 LV6
2023年3月12日
sweetlove LV20
2022年11月2日
jimodeai LV15
2022年10月31日
微信网友_5952527027507200 LV1
2022年6月20日
12koko LV3
2022年6月5日
1690356080 LV38
2022年5月28日
zhuxxiaoh LV8
2022年5月19日
最近浏览更多
zolscy LV24
2024年11月28日
xiao小果 LV13
2024年8月27日
荣》Cowboy LV12
2024年4月11日
qq1357574774 LV2
2024年3月28日
Gin19960217 LV4
2024年3月18日
皇甫科昊
2024年3月7日
暂无贡献等级
akkye_7 LV1
2024年1月11日
WBelong LV8
2023年12月25日
pokerf LV5
2023年12月19日
wdw2444156008
2023年11月13日
暂无贡献等级

