想学习一下bootstrap,在某个网站上找了个源码,然后借鉴了一下,那个项目用的ssh,我感觉现在ssm用的比较多,所以换了一下
http://www.52itstyle.com/thread-1348-1-1.html
这个是他的源码贴 要解压密码的,好像是他们网站拼音。。
这个小项目还有一写功能(一些删除,拦截器) 没完善,不过不影响了,有心的可以改一下
细节上有些处理的不好,希望多给一些建议
源码下载链接
http://download.csdn.net/detail/aofengcanyue/9610960
配置文件
application.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:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation=" http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
"
>
<!-- 数据源 -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="oracle.jdbc.OracleDriver" />
<property name="url" value="jdbc:oracle:thin:@localhost:1521:orcl" />
<property name="username" value="liuwenlai" />
<property name="password" value="123" />
<property name="initialSize" value="5" />
<property name="maxActive" value="100" />
<property name="maxIdle" value="30" />
<property name="maxWait" value="1000" />
</bean>
<context:component-scan base-package="com.web"/>
<mvc:annotation-driven/>
<!-- 引入mybatis配置文件 -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<property name="configLocation" value="classpath:mybatis-config.xml"></property>
<!-- <property name="mapperLocations" value="classpath:com/web/mapper/*.xml"></property> -->
</bean>
<!-- mapper接口-->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property>
<property name="basePackage" value="com.web.dao"></property><!-- 指向dao的接口包 -->
</bean>
<!-- 连接事务的注解配置 --><!-- mybatis的datasource -->
<tx:annotation-driven transaction-manager="transactionManager" />
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager" >
<property name="dataSource" ref="dataSource" />
</bean>
<!-- 登陆拦截器 -->
<!-- <mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/*"/>
<bean autowire="default"></bean>
login validate不拦截
</mvc:interceptor>
<mvc:interceptor>
<mvc:mapping path="/*"/>
<bean class=""/>
</mvc:interceptor>
</mvc:interceptors> -->
<!-- <aop:config proxy-target-class="true"></aop:config> -->
<!-- 文件上传 与request转换类型有关-->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver" />
</beans>
控制跳转
<?xml version="1.0" encoding="UTF-8"?>
<beans default-lazy-init="true"
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:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd" default-autowire="byName">
<!-- 使用注解的包,包括子集 -->
<!-- <context:component-scan base-package="com.web" /> -->
<!-- 通过注解,把URL映射到Controller上,该标签默认注册DefaultAnnotationHandlerMapping和AnnotationMethodHandlerAdapter -->
<!-- <mvc:annotation-driven/> -->
<!-- 3.0.4 提供-->
<!-- <mvc:resources location="/bootstrap/" mapping="/bootstrap/**"></mvc:resources>
<mvc:resources location="/js/" mapping="/js/**"></mvc:resources>
<mvc:resources location="/images/" mapping="/images/**"></mvc:resources>
<mvc:resources location="/webtestCss/" mapping="/webtestCss/**"></mvc:resources> -->
<!--
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="/WEB-INF/pages/" />
<property name="suffix" value=".jsp"></property>
</bean> -->
<!-- 返回路径的前缀与后缀 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="/WEB-INF/pages/"></property>
<property name="suffix" value=".jsp"></property>
</bean>
</beans>
mybatis
<?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>
<typeAliases>
<typeAlias type="com.web.entity.UserBean" alias="UserBean"/>
<package name="com.web.entity"/>
</typeAliases>
<mappers>
<!-- 自动寻找xxx.java名字相同的xxx.xml文件 -->
<!-- <package name="com.web.mapper"/> -->
<mapper resource="com/web/mapper/LoginMapper.xml" /><!-- 名字文件夹用斜杠 -->
<mapper resource="com/web/mapper/ReportDetailsMapper.xml" />
<mapper resource="com/web/mapper/UserBeanMapper.xml" />
<mapper resource="com/web/mapper/MenuMapper.xml" />
<mapper resource="com/web/mapper/MenuTypeMapper.xml" />
<mapper resource="com/web/mapper/TableMapper.xml" />
<mapper resource="com/web/mapper/OrderMapper.xml" />
<mapper resource="com/web/mapper/OrderDetailsMapper.xml" />
<!-- <mapper resource="com/web/mapper/MenuMapper.xml" />
<mapper resource="com/web/mapper/MenuTypeMapper.xml" />
<mapper resource="com/web/mapper/OrderMapper.xml" />
<mapper resource="com/web/mapper/ReportDetailsMapper.xml" />
<mapper resource="com/web/mapper/TableMapper.xml" />
<mapper resource="com/web/mapper/UserBeanMapper.xml" /> -->
<!-- <mapper resource="com/web/mapper/.xml" /> -->
</mappers>
</configuration>