SSM酒店预订客房管理系统(包含数据库及项目说明)

hotel

预订宾馆客房入住管理系统 – SSM项目

项目下载:https://download.csdn.net/download/weixin_45606067/12673204

功能简介

前台给用户界面展示信息,以及查询相关信息。

后台有登录功能,及数据校验,相关模块的增删改查功能 ,分页,按条件查询等,以及将数据以excel形式导出。

实体类介绍

  • 用户:用户名,登录密码,姓名,性别,用户照片,出生日期,身份证号,联系电话,邮箱,家庭地址。
  • 房间类型:类型id,房间类型,价格(每天)。
  • 房间:房间号,房间类型,房间图片,价格(每天),楼层,占用状态,房间描述。
  • 房间预订: 订单id,预订房间,房间类型,预订人,入住日期,预订天数,总价,订单备注,订单状态,预订时间。
  • 留言: 留言id,留言标题,留言内容,留言人,留言时间,管理回复,回复时间。
  • 新闻公告: 公告id,标题,公告内容,点击率,发布时间。

使用技术

Maven构建项目
后台:Spring + SpringMVC + MyBatis
前台:easyUI
开发工具:IDEA

部分效果图展示

前台效果
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

后台效果
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

配置文件整合说明

maven坐标(pom.xml)

  1. 单元测试类
  2. 数据库驱动
  3. 数据库连接池
  4. Servlet - jsp
  5. Mybatis
  6. Spring
  7. 处理事务
  8. 日志log4j、slf4j
  9. 缓存
  10. 数据校验
  11. json
  12. 上传下载
  13. 编码方法工具包
  14. lombok
  15. pageHelper分页插件
  16. 静态资源导出问题

applicationContext.xml

dao层

  1. 开启注解扫描(不扫描controller)
  2. 关联数据库文件
  3. 配置连接池
  4. 配置sqlSessionFactory工厂
    1. 数据源连接池
    2. 绑定Mybatis配置文件
    3. 配置pageHelper
  5. 配置dao/mapper接口所在包

service层

  1. 开启service的扫描
  2. 如果service层没用注解,需要把所有业务类注入到bean中
  3. 配置声明式事务
    1. 数据源连接池
  4. 配置事务通知
  5. 配置事务织入

spring-mvc.xml

  1. 开启注解扫描(只扫描Controller)
  2. 配置视图解析器
  3. 过滤静态资源
  4. 开始注解支持
  5. 配置上传下载
  6. 国际化配置
  7. 注册验证器

mybatis-config.xml

  1. sout的日志开启
  2. 配置别名
  3. 配置pageHelper分页
  4. xxxMapper的扫描

web.xml

  1. 注册DispatcherServlet
  2. 编码过滤器
  3. Session过期时间

通用配置文件代码

对应jar包

<dependencies>
  <!--junit单元测试-->
   <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <version>4.12</version>
   </dependency>
   <!--数据库驱动-->
   <dependency>
       <groupId>mysql</groupId>
       <artifactId>mysql-connector-java</artifactId>
       <version>5.1.32</version>
   </dependency>
   <!--数据库连接池:c3p0,dbcp-->
   <dependency>
       <groupId>com.mchange</groupId>
       <artifactId>c3p0</artifactId>
       <version>0.9.5.2</version>
   </dependency>
   <dependency>
       <groupId>commons-dbcp</groupId>
       <artifactId>commons-dbcp</artifactId>
       <version>1.4</version>
   </dependency>

   <!--Servlet - jsp-->
   <dependency>
       <groupId>javax.servlet</groupId>
       <artifactId>servlet-api</artifactId>
       <version>2.5</version>
   </dependency>
   <dependency>
       <groupId>javax.servlet.jsp</groupId>
       <artifactId>jsp-api</artifactId>
       <version>2.2</version>
   </dependency>
   <dependency>
       <groupId>javax.servlet</groupId>
       <artifactId>jstl</artifactId>
       <version>1.2</version>
   </dependency>

   <dependency>
       <groupId>org.apache.poi</groupId>
       <artifactId>poi</artifactId>
       <version>3.11</version>
   </dependency>

   <!--log4j-->
   <dependency>
       <groupId>log4j</groupId>
       <artifactId>log4j</artifactId>
       <version>1.2.17</version>
   </dependency>
   <!--slf4j   1.7.21-->
   <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
       <version>1.6.6</version>
   </dependency>
   <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-log4j12</artifactId>
       <version>1.6.6</version>
   </dependency>

   <!--缓存-->
   <dependency>
       <groupId>net.sf.ehcache</groupId>
       <artifactId>ehcache-core</artifactId>
       <version>2.6.6</version>
   </dependency>
   <!--数据校验-->
   <dependency>
       <groupId>org.hibernate</groupId>
       <artifactId>hibernate-validator</artifactId>
       <version>5.4.1.Final</version>
   </dependency>
   <dependency>
       <groupId>javax.validation</groupId>
       <artifactId>validation-api</artifactId>
       <version>1.1.0.Final</version>
   </dependency>

   <!--json-->
   <dependency>
       <groupId>net.sf.json-lib</groupId>
       <artifactId>json-lib</artifactId>
       <version>2.4</version>
   </dependency>

   <!--Mybatis-->
   <dependency>
       <groupId>org.mybatis</groupId>
       <artifactId>mybatis</artifactId>
       <version>3.5.2</version>
   </dependency>
   <dependency>
       <groupId>org.mybatis</groupId>
       <artifactId>mybatis-spring</artifactId>
       <version>2.0.2</version>
   </dependency>
   <!--Spring-->
   <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-webmvc</artifactId>
       <version>5.2.0.RELEASE</version>
   </dependency>
   <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-jdbc</artifactId>
       <version>5.2.0.RELEASE</version>
   </dependency>
   <!--事务处理-->
   <dependency>
       <groupId>org.aspectj</groupId>
       <artifactId>aspectjweaver</artifactId>
       <version>1.8.13</version>
   </dependency>
   <dependency>
       <groupId>aopalliance</groupId>
       <artifactId>aopalliance</artifactId>
       <version>1.0</version>
   </dependency>
   <dependency>
       <groupId>asm</groupId>
       <artifactId>asm</artifactId>
       <version>3.3.1</version>
   </dependency>
   <dependency>
       <groupId>cglib</groupId>
       <artifactId>cglib</artifactId>
       <version>2.2</version>
   </dependency>

   <!--文件上传下载-->
   <dependency>
       <groupId>commons-fileupload</groupId>
       <artifactId>commons-fileupload</artifactId>
       <version>1.3.3</version>
   </dependency>
   <dependency>
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
       <version>2.4</version>
   </dependency>


   <!--编码方法的工具类包-->
   <dependency>
       <groupId>commons-codec</groupId>
       <artifactId>commons-codec</artifactId>
       <version>1.9</version>
   </dependency>


   <!--lombok-->
   <dependency>
       <groupId>org.projectlombok</groupId>
       <artifactId>lombok</artifactId>
       <version>1.18.8</version>
   </dependency>
   <!--引入pageHelper分页插件 -->
   <dependency>
       <groupId>com.github.pagehelper</groupId>
       <artifactId>pagehelper</artifactId>
       <version>5.1.2</version>
   </dependency>
</dependencies>

<!--静态资源导出问题-->
<build>
   <resources>
       <resource>
           <directory>src/main/resources</directory>
           <includes>
               <include>**/*.properties</include>
               <include>**/*.xml</include>
           </includes>
           <filtering>true</filtering>
       </resource>
       <resource>
           <directory>src/main/java</directory>
           <includes>
               <include>**/*.properties</include>
               <include>**/*.xml</include>
           </includes>
           <filtering>true</filtering>
       </resource>
   </resources>
</build>

mybatis-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration
        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
    <!-- 全局setting配置,根据需要添加 -->

    <!-- 配置别名 -->
    <typeAliases>
        <!-- 批量扫描别名 -->
        <package name="com.kuang.pojo"/>
    </typeAliases>

    <!-- 配置mapper
    由于使用spring和mybatis的整合包进行mapper扫描,这里不需要配置了。
    必须遵循:mapper.xml和mapper.java文件同名且在一个目录
     -->

    <!-- <mappers>

    </mappers> -->
</configuration>

log4j.properties

# Global logging configuration,建议开发环境中要用debug
log4j.rootLogger=DEBUG, stdout
# Console output...
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n

jdbc.properties

#数据库参数配置
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://127.0.0.1:3306/hotel_db?useUnicode=true&characterEncoding=utf-8
jdbc.username=root
jdbc.password=123456
#定义初始连接数  
initialSize=0
#定义最大连接数  
maxActive=20
#定义最大空闲  
maxIdle=20
#定义最小空闲  
minIdle=1
#定义最长等待时间  
maxWait=60000

springmvc.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd">

    <context:component-scan base-package="com.kuang.controller"/>

    <!--配置的视图解析器对象-->
    <bean id="internalResourceViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <!-- 视图的前缀 /WEB-INF/jsp/-->
        <property name="prefix" value="/"/>
        <!-- 视图的后缀 -->
        <property name="suffix" value=".jsp"/>
        <!-- 定了前后缀之后,如果返回的视图字符串是"login",经过视图解析器之后,
        则视图的完整路径为:/WEB-INF/pages/login.jsp
        这里没有配置处理器映射器和处理器适配器,表示Spring使用默认的处理映射器和处理器适配器处理请求
        不要忘记在web.xml中配置SpringMVC的前端控制器DispatcherServlet -->
    </bean>

    <!--开启注解支持-->
    <mvc:annotation-driven/>

    <!--过滤静态资源-->
    <mvc:default-servlet-handler/>

    <!--文件上传-->
    <bean id="multipartResolver"  class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
        <!-- 设置上传文件的最大尺寸为2MB -->
        <property name="maxUploadSize">
            <value>2097152</value>
        </property>
    </bean>

    <!-- SpringMVC在超出上传文件限制时,会抛出org.springframework.web.multipart.MaxUploadSizeExceededException -->
    <!-- 该异常是SpringMVC在检查上传的文件信息时抛出来的,而且此时还没有进入到Controller方法中 -->
    <bean id="exceptionResolver"
          class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
        <property name="exceptionMappings">
            <props>
                <!-- 遇到MaxUploadSizeExceededException异常时,自动跳转到/WEB-INF/jsp/error_fileupload.jsp页面 -->
                <prop key="org.springframework.web.multipart.MaxUploadSizeExceededException">upload_error</prop>

                <prop key="com.kuang.utils.UserException">user_error</prop>
            </props>
        </property>
    </bean>

    <!-- 国际化配置
    <bean id="localeResolver" class="org.springframework.web.servlet.i18n.CookieLocaleResolver" />
    <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
    	<property name="basenames">
    		<list>
    			<value>classpath:resource/ValidationMessages</value>
    		</list>
    	</property>
    	<property name="useCodeAsDefaultMessage" value="true" />
    </bean>-->

    <!-- 注册验证器 -->
    <mvc:annotation-driven validator="validator" />
    <bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean">
        <property name="providerClass" value="org.hibernate.validator.HibernateValidator" />
        <!--这里配置将使用上面国际化配置的messageSource
        <property name="validationMessageSource" ref="messageSource" />
         -->
    </bean>

</beans>

spring-dao.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
	http://www.springframework.org/schema/beans/spring-beans.xsd
	http://www.springframework.org/schema/context
	http://www.springframework.org/schema/context/spring-context.xsd">

    <!-- 加载db.properties文件中的内容,db.properties文件中key命名要有一定的特殊规则 -->
    <context:property-placeholder location="classpath:jdbc.properties" />
    <!-- 配置数据源 ,dbcp -->
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
          destroy-method="close">
        <property name="driverClassName" value="${jdbc.driver}" />
        <property name="url" value="${jdbc.url}" />
        <property name="username" value="${jdbc.username}" />
        <property name="password" value="${jdbc.password}" />
        <property name="maxActive" value="30" />
        <property name="maxIdle" value="5" />
    </bean>

    <!-- sqlSessionFactory -->
    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <!-- 数据库连接池 -->
        <property name="dataSource" ref="dataSource" />
        <!-- 加载mybatis的全局配置文件 -->
        <property name="configLocation" value="classpath:mybatis-config.xml" />
    </bean>

    <!-- mapper扫描器 -->
    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <!-- 扫描包路径,如果需要扫描多个包,中间使用半角逗号隔开 -->
        <property name="basePackage" value="com.kuang.mapper"></property>
        <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
    </bean>
</beans>

spring-service.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
	http://www.springframework.org/schema/beans/spring-beans.xsd
	http://www.springframework.org/schema/context
	http://www.springframework.org/schema/context/spring-context.xsd
	http://www.springframework.org/schema/aop
	http://www.springframework.org/schema/aop/spring-aop.xsd
	http://www.springframework.org/schema/tx
	http://www.springframework.org/schema/tx/spring-tx.xsd">

    <!-- 配置实际的service -->
    <!-- <bean id="itemsService" class="com.ssm.service.impl.ItemsServiceImpl"/> -->

    <!-- 打开Spring的Annotation支持 -->
    <context:annotation-config />

    <!-- 设定Spring 去哪些包中找Annotation -->
    <context:component-scan base-package="com.kuang.service"/>

    <!-- 事务管理器:对mybatis操作数据库事务控制,spring使用jdbc的事务控制类-->
    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <!-- dataSource在applicationContext-dao.xml中配置了 -->
        <property name="dataSource" ref="dataSource"/>
    </bean>
    <!-- 以前的方法是这样管理事务的:使用基于注解方式配置事务
    <tx:annotation-driven transaction-manager="transactionManager"/>
    -->

    <!-- 现在使用通知的方式管理 -->
    <tx:advice id="txAdvice" transaction-manager="transactionManager">
        <tx:attributes>
            <!-- 传播行为  -->
            <tx:method name="save*" propagation="REQUIRED"/>
            <tx:method name="delete*" propagation="REQUIRED"/>
            <tx:method name="insert*" propagation="REQUIRED"/>
            <tx:method name="update*" propagation="REQUIRED"/>
            <tx:method name="find*" propagation="SUPPORTS" read-only="true"/>
            <tx:method name="query*" propagation="SUPPORTS" read-only="true"/>
            <tx:method name="get*" propagation="SUPPORTS" read-only="true"/>
            <tx:method name="select*" propagation="SUPPORTS" read-only="true"/>
            <tx:method name="*" propagation="REQUIRED"/>
        </tx:attributes>
    </tx:advice>

    <!-- 要扫描的service包 aop   -->
    <aop:config>
        <aop:advisor advice-ref="txAdvice" pointcut="execution(* com.kuang.service.*.*(..))"/>
    </aop:config>
</beans>

applicationContext.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
	http://www.springframework.org/schema/beans/spring-beans.xsd
	http://www.springframework.org/schema/context
	http://www.springframework.org/schema/context/spring-context.xsd">

    <import resource="classpath:spring-dao.xml"/>
    <import resource="classpath:spring-service.xml"/>
    <import resource="classpath:springmvc.xml"/>

</beans>

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
         version="4.0">

    <!-- 指定spring的配置文件,默认从web根目录寻找配置文件,我们可以通过spring提供的classpath:前缀指定从类路径下寻找 -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:applicationContext.xml</param-value>
    </context-param>

    <!-- 对Spring容器进行实例化 -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <!-- springmvc前端控制器,rest配置 -->
    <servlet>
        <servlet-name>dispatcherServlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <!-- contextConfigLocation配置springmvc加载的配置文件(配置处理器映射器、适配器等等)
        如果不配置contextConfigLocation,默认加载的是/WEB-INF/servlet名称-serlvet.xml(springmvc-servlet.xml) -->
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:springmvc.xml</param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>dispatcherServlet</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

    <!--编码过滤器-->
    <filter>
        <filter-name>CharacterFilter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>CharacterFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <!--session过期时间-->
    <session-config>
        <session-timeout>15</session-timeout>
    </session-config>

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
</web-app>

项目中遇见的问题

request.getcontextPath() 详解

  1. jsp页面中代码
<%
  String path = request.getContextPath();
  String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
  1. 解释说明

request.getScheme():
返回的协议名称,默认是http

request.getServerName():
返回的是你浏览器中显示的主机名,你自己试一下就知道了

getServerPort():
获取服务器端口号

request.getContextPath()应该是得到项目的名字,如果项目为根目录,则得到一个"",即空的字条串。如果项目为abc,<%=request.getContextPath()%>将得到abc,服务器端的路径则会自动加上,<a href="XXXX.jsp">是指当前路径下的这个xxx.jsp页面,有时候也可以在head里设置html:base来解决路径的问题,不过用的最多的还是request.getContextPath。

在js文件中得到request.getContextPath()的值,不想在JSP中写太多的Javascript代码:

一种方法是用hidden:
<input type=hidden name=contextPath value=<%= request.getContextPath()>

JSR303校验之@NotEmpty注解

@NotEmpty 用在集合类上面
加了@NotEmpty的String类、Collection、Map、数组,是不能为null或者长度为0的(String Collection Map的isEmpty()方法)。

@NotBlank只用于String,不能为null且trim()之后size>0。

@NotNull:不能为null,但可以为empty,没有Size的约束。

@SessionAttributes注解

@SessionAttributes 只能作用在类上,作用是将指定的Model中的键值对添加至session中,方便在下一次请求中使用。

@Resource注解

@Resource和@Autowired注解都是用来实现依赖注入的。只是@AutoWried按by type自动注入,而@Resource默认按byName自动注入。

@Resource有两个重要属性,分别是name和type

spring将name属性解析为bean的名字,而type属性则被解析为bean的类型。所以如果使用name属性,则使用byName的自动注入策略,如果使用type属性则使用byType的自动注入策略。如果都没有指定,则通过反射机制使用byName自动注入策略。

详细可看:https://blog.csdn.net/weixin_45606067/article/details/107683765

@Validated注解

@validated来校验数据,如果数据异常则会统一抛出异常,方便异常中心统一处理。

比如,我们判断一个输入参数是否合法

详细可看:https://blog.csdn.net/qq_27680317/article/details/79970590

涉及BindingResult类的详解:

http://blog.sina.com.cn/s/blog_6829be5c0101alxh.html

@Param

@Param是MyBatis所提供的(org.apache.ibatis.annotations.Param),作为Dao层的注解,作用是用于传递参数,从而可以与SQL中的的字段名相对应,一般在2=<参数数<=5时使用最佳。

resultMap结果集

详细可以看:https://blog.csdn.net/weixin_45606067/article/details/107683253

JSON传值问题

运用的是Struts2返回JSON数据的具体应用范例:在这里插入图片描述

分页名词含义

startIndex:开始页码
currentPage:当前页
rows:每页显示记录数目
totalPage:查询后的总页数
recordNumber:查询到的总记录数
pageSize:每页显示多少条数据

sql中的:
limit #{startIndex},#{pageSize}

业务代码中的:
int startIndex = (currentPage-1) * this.rows;

JavaScript eval() 函数

eval() 函数可计算某个字符串,并执行其中的的 JavaScript 代码。

返回值
通过计算 string 得到的值(如果有的话)。

说明
该方法只接受原始字符串作为参数,如果 string 参数不是原始字符串,那么该方法将不作任何改变地返回。因此请不要为 eval() 函数传递 String 对象来作为参数。

如果试图覆盖 eval 属性或把 eval() 方法赋予另一个属性,并通过该属性调用它,则 ECMAScript 实现允许抛出一个 EvalError 异常。

抛出
如果参数中没有合法的表达式和语句,则抛出 SyntaxError 异常。
如果非法调用 eval(),则抛出 EvalError 异常。
如果传递给 eval() 的 Javascript 代码生成了一个异常,eval() 将把该异常传递给调用者。

@InitBinder注解

这个的作用是给Binder做初始化的,被此注解的方法可以对WebDataBinder初始化。webDataBinder是用于表单到方法的数据绑定的!

@InitBinder只在@Controller中注解方法来为这个控制器注册一个绑定器初始化方法,方法只对本控制器有效。

详细可看:https://blog.csdn.net/qq_38016931/article/details/82080940
结合着看:https://blog.csdn.net/qq_24505127/article/details/54236583


如果有收获!!! 希望老铁们来个三连,点赞、收藏、转发。
创作不易,别忘点个赞,可以让更多的人看到这篇文章,顺便鼓励我写出更好的博客
  • 13
    点赞
  • 58
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
酒 店 管 理 系 统 一、背景说明 目前大多数酒店提供的服务多种多样,规模大小也各不相同,但稍具规模的酒店必含下面三类服务:饮食、住宿和娱乐。由于我们对酒店行业没有具体的接触和实质性的了解。此次数据库设计只能在一些收集到的基本材料与个人直观认识的基础上,简单模仿中等规模的酒店设计管理系统,并将其抽象成一个由三部门组成、实现三大服务的系统。 二、部门的划分 饮食部门   它是酒店基本部门之一。它提供服务的特点是实时性强、持续时间短,强调效率。例如,顾客人数、顾客所用的菜及其它饮料等种类繁多,数量不等;后勤各种活动如采购等频繁发生。通过分析可发现,用人工完成此类操作比计算机更具实效与时效,且此类信息也没有长时间保留的必要,因此这些信息没有必要采用数据库管理。对于饮食部门,需要较长时间保留的信息主要是财务信息,一方面便于期末汇总,另一方面便于向上级报告。   在规模较大的酒店餐饮服务部分,餐厅可分成几个等级或几个小部门,然后各自形成小系统,本系统为了简单起见,把饮食部门作为一个子系统,不再细分。 住宿管理部门   它也是酒店基本部门之一。住宿管理部门的主要职责有:A.给个房间布置各种设备、分类、编号、制定收费标准、分配服务人员。B.登记旅客信息,确认其身份,登记其入住、退房时间。C.统计各类房间的客满程度。D.对本部门的财务流动进行登记处理。以上信息处理可以通过计算机完成,其他不便于计算机操作的在此没有列出。 娱乐管理部门   娱乐是酒店非主流服务,它的存在除了赢利,更多的是为了吸引顾客食宿。娱乐部门的特点与饮食部门很相似,不便于使用计算机进行操作。可以用计算机完成并且有必要用计算机完成的有:A.制定收费标准,分配负责人.B.收入支出财务处理:编号、财务来源去处的摘要、数量、单价、数额、结余、经手人等。这些信息都需要长时间保留并上报。 经理部门 经理部门的功能虽然不是面向顾客、不是酒店的服务项之一,但它的存在却是必不可少的。它的主要职责有:A.管理员工。给员工编号,登记其基本信息;根据员工的平时表现及工龄确定工资;此外,还要给员工分配工作部门及职务等等。B.划分部门。给个部门编号、命名、确定其职责范围、任命部门经理、分配员工。C.对本部门的财务进行核算(支付工资等)。D.期末对酒店的收益情况进行核算。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值