// Path: src/main/java/com/phn/bookhouse/entity/House.java
// public class House {
// 	private long hous_id;
// 	private String hous_login_name;
// 	private String hous_login_email;
// 	private String hous_login_password;
// 	private String hous_name;
// 	private String hous_logo;
// 	private String hous_phone;
// 	private String hous_company_name;
// 	private String hous_company_addr;
// 	private double hous_score_description;
// 	private double hous_score_service;
// 	private double hous_score_speed;
// 
// 	public long getHous_id() {
// 		return hous_id;
// 	}
// 
// 	public void setHous_id(long hous_id) {
// 		this.hous_id = hous_id;
// 	}
// 
// 	public String getHous_login_name() {
// 		return hous_login_name;
// 	}
// 
// 	public void setHous_login_name(String hous_login_name) {
// 		this.hous_login_name = hous_login_name;
// 	}
// 
// 	public String getHous_login_email() {
// 		return hous_login_email;
// 	}
// 
// 	public void setHous_login_email(String hous_login_email) {
// 		this.hous_login_email = hous_login_email;
// 	}
// 
// 	public String getHous_login_password() {
// 		return hous_login_password;
// 	}
// 
// 	public void setHous_login_password(String hous_login_password) {
// 		this.hous_login_password = hous_login_password;
// 	}
// 
// 	public String getHous_name() {
// 		return hous_name;
// 	}
// 
// 	public void setHous_name(String hous_name) {
// 		this.hous_name = hous_name;
// 	}
// 
// 	public String getHous_logo() {
// 		return hous_logo;
// 	}
// 
// 	public void setHous_logo(String hous_logo) {
// 		this.hous_logo = hous_logo;
// 	}
// 
// 	public String getHous_phone() {
// 		return hous_phone;
// 	}
// 
// 	public void setHous_phone(String hous_phone) {
// 		this.hous_phone = hous_phone;
// 	}
// 
// 	public String getHous_company_name() {
// 		return hous_company_name;
// 	}
// 
// 	public void setHous_company_name(String hous_company_name) {
// 		this.hous_company_name = hous_company_name;
// 	}
// 
// 	public String getHous_company_addr() {
// 		return hous_company_addr;
// 	}
// 
// 	public void setHous_company_addr(String hous_company_addr) {
// 		this.hous_company_addr = hous_company_addr;
// 	}
// 
// 	public double getHous_score_description() {
// 		return hous_score_description;
// 	}
// 
// 	public void setHous_score_description(double hous_score_description) {
// 		this.hous_score_description = hous_score_description;
// 	}
// 
// 	public double getHous_score_service() {
// 		return hous_score_service;
// 	}
// 
// 	public void setHous_score_service(double hous_score_service) {
// 		this.hous_score_service = hous_score_service;
// 	}
// 
// 	public double getHous_score_speed() {
// 		return hous_score_speed;
// 	}
// 
// 	public void setHous_score_speed(double hous_score_speed) {
// 		this.hous_score_speed = hous_score_speed;
// 	}
// 
// }


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import com.phn.bookhouse.entity.House;
package com.phn.bookhouse.interceptor;




public class HouseInterceptor implements HandlerInterceptor {

	@Override
	public void afterCompletion(HttpServletRequest request,
			HttpServletResponse response, Object handler, Exception ex)
			throws Exception {
		System.out.println("最后执行！！！一般用于释放资源！！");

	}

	@Override
	public void postHandle(HttpServletRequest request,
			HttpServletResponse response, Object handler,
			ModelAndView modelAndView) throws Exception {
		System.out.println("Action执行之后，生成视图之前执行！！");
	}

	@Override
	public boolean preHandle(HttpServletRequest request,
			HttpServletResponse response, Object handler) throws Exception {
		System.out.println("action之前执行！！！");
		// 获取request对象
		// HttpServletRequest request = ((ServletRequestAttributes)
		// RequestContextHolder.getRequestAttributes()).getRequest();
		// 获取session对象
		HttpSession session = request.getSession(true);
// Path: src/main/java/com/phn/bookhouse/entity/House.java
// public class House {
// 	private long hous_id;
// 	private String hous_login_name;
// 	private String hous_login_email;
// 	private String hous_login_password;
// 	private String hous_name;
// 	private String hous_logo;
// 	private String hous_phone;
// 	private String hous_company_name;
// 	private String hous_company_addr;
// 	private double hous_score_description;
// 	private double hous_score_service;
// 	private double hous_score_speed;
// 
// 	public long getHous_id() {
// 		return hous_id;
// 	}
// 
// 	public void setHous_id(long hous_id) {
// 		this.hous_id = hous_id;
// 	}
// 
// 	public String getHous_login_name() {
// 		return hous_login_name;
// 	}
// 
// 	public void setHous_login_name(String hous_login_name) {
// 		this.hous_login_name = hous_login_name;
// 	}
// 
// 	public String getHous_login_email() {
// 		return hous_login_email;
// 	}
// 
// 	public void setHous_login_email(String hous_login_email) {
// 		this.hous_login_email = hous_login_email;
// 	}
// 
// 	public String getHous_login_password() {
// 		return hous_login_password;
// 	}
// 
// 	public void setHous_login_password(String hous_login_password) {
// 		this.hous_login_password = hous_login_password;
// 	}
// 
// 	public String getHous_name() {
// 		return hous_name;
// 	}
// 
// 	public void setHous_name(String hous_name) {
// 		this.hous_name = hous_name;
// 	}
// 
// 	public String getHous_logo() {
// 		return hous_logo;
// 	}
// 
// 	public void setHous_logo(String hous_logo) {
// 		this.hous_logo = hous_logo;
// 	}
// 
// 	public String getHous_phone() {
// 		return hous_phone;
// 	}
// 
// 	public void setHous_phone(String hous_phone) {
// 		this.hous_phone = hous_phone;
// 	}
// 
// 	public String getHous_company_name() {
// 		return hous_company_name;
// 	}
// 
// 	public void setHous_company_name(String hous_company_name) {
// 		this.hous_company_name = hous_company_name;
// 	}
// 
// 	public String getHous_company_addr() {
// 		return hous_company_addr;
// 	}
// 
// 	public void setHous_company_addr(String hous_company_addr) {
// 		this.hous_company_addr = hous_company_addr;
// 	}
// 
// 	public double getHous_score_description() {
// 		return hous_score_description;
// 	}
// 
// 	public void setHous_score_description(double hous_score_description) {
// 		this.hous_score_description = hous_score_description;
// 	}
// 
// 	public double getHous_score_service() {
// 		return hous_score_service;
// 	}
// 
// 	public void setHous_score_service(double hous_score_service) {
// 		this.hous_score_service = hous_score_service;
// 	}
// 
// 	public double getHous_score_speed() {
// 		return hous_score_speed;
// 	}
// 
// 	public void setHous_score_speed(double hous_score_speed) {
// 		this.hous_score_speed = hous_score_speed;
// 	}
// 
// }


// Path: src/main/java/com/phn/bookhouse/interceptor/HouseInterceptor.java
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import com.phn.bookhouse.entity.House;

package com.phn.bookhouse.interceptor;




public class HouseInterceptor implements HandlerInterceptor {

	@Override
	public void afterCompletion(HttpServletRequest request,
			HttpServletResponse response, Object handler, Exception ex)
			throws Exception {
		System.out.println("最后执行！！！一般用于释放资源！！");

	}

	@Override
	public void postHandle(HttpServletRequest request,
			HttpServletResponse response, Object handler,
			ModelAndView modelAndView) throws Exception {
		System.out.println("Action执行之后，生成视图之前执行！！");
	}

	@Override
	public boolean preHandle(HttpServletRequest request,
			HttpServletResponse response, Object handler) throws Exception {
		System.out.println("action之前执行！！！");
		// 获取request对象
		// HttpServletRequest request = ((ServletRequestAttributes)
		// RequestContextHolder.getRequestAttributes()).getRequest();
		// 获取session对象
		HttpSession session = request.getSession(true);
		House house = (House) session.getAttribute("loginHouse");