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>
<package name="com.cx.pojo"></package>
</typeAliases>
<plugins>
<plugin interceptor="com.github.pagehelper.PageHelper">
<property name="dialect" value="mysql"></property>
<property name="reasonable" value="true"></property>
</plugin>
</plugins>
</configuration>
spring的配置 :数据库配置只配了基本信息,其他信息为默认 信息,可自行修改
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
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-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
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
<!-- 配置外部数据库连接信息-->
<context:property-placeholder location="classpath:db.properties"/>
<!-- 配置数据源 -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="url" value="${jdbc.url}" />
<property name="driverClassName" value="${jdbc.driverClassName}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
</bean>
<!-- 配置SqlSessionFactory -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<property name="configLocation" value="classpath:mybatis/SqlMapConfig.xml"></property>
</bean>
<!-- 配置mapper的扫描 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.web.oa.mapper"></property>
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property>
</bean>
<!-- 扫描service包,托管 业务类-->
<context:component-scan base-package="com.web.oa.service.impl"/>
<!--
配置事务
-->
<!-- 1.配置事务管理器 -->
<bean id="transManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"></property>
</bean>
<!-- 2.配置事务通知 -->
<tx:advice id="txAdvice" transaction-manager="transManager">
<tx:attributes>
<tx:method name="save*" isolation="DEFAULT" propagation="REQUIRED" read-only="false"/>
<tx:method name="add*" isolation="DEFAULT" propagation="REQUIRED" read-only="false"/>
<tx:method name="update*" isolation="DEFAULT" propagation="REQUIRED" read-only="false"/>
<tx:method name="delete*" isolation="DEFAULT" propagation="REQUIRED" read-only="false"/>
<tx:method name="*" read-only="true" />
</tx:attributes>
</tx:advice>
<!-- 3.配置切面 -->
<aop:config>
<aop:pointcut expression="execution(* com.web.oa.service.*.*(..))" id="aopPointcut"/>
<aop:advisor advice-ref="txAdvice" pointcut-ref="aopPointcut" />
</aop:config>
<!-- 导入相关配置 -->
<import resource="classpath:spring/activiti-context.xml"/>
<import resource="classpath:spring/applicationContext-shiro.xml"/>
</beans>
activiti 配置文件
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
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/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<!-- spring负责创建流程引擎的配置文件 -->
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<!-- 数据源 -->
<property name="dataSource" ref="dataSource" />
<!-- 配置事务管理器,统一事务 -->
<property name="transactionManager" ref="transManager" />
<!-- 设置建表策略,如果没有表,自动创建表 -->
<property name="databaseSchemaUpdate" value="true" />
</bean>
<!-- 创建流程引擎对象 -->
<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
<property name="processEngineConfiguration" ref="processEngineConfiguration" />
</bean>
<!-- 由流程引擎对象,提供的方法,创建项目中使用的Activiti工作流的Service -->
<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
<bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />
<bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
<bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
<bean id="formService" factory-bean="processEngine" factory-method="getFormService" />
</beans>
shiro配置
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
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-3.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.2.xsd ">
<!-- 开启aop,对类代理 -->
<aop:config proxy-target-class="true"></aop:config>
<!-- 开启shiro注解支持 -->
<bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
<property name="securityManager" ref="securityManager" />
</bean>
<!-- web.xml中shiro的filter对应的bean -->
<!-- Shiro 的Web过滤器 -->
<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
<property name="securityManager" ref="securityManager" />
<!-- loginUrl认证提交地址,如果没有认证将会请求此地址进行认证,请求此地址将由formAuthenticationFilter进行表单认证 -->
<property name="loginUrl" value="/login" />
<!-- 认证成功统一跳转到main,建议不配置,shiro认证成功自动到上一个请求路径 -->
<property name="successUrl" value="/main" />
<!-- 通过unauthorizedUrl指定没有权限操作时跳转页面 -->
<property name="unauthorizedUrl" value="/refuse.html" />
<!-- 自定义filter配置 -->
<property name="filters">
<map>
<!-- 将自定义 的FormAuthenticationFilter注入shiroFilter中-->
<entry key="authc" value-ref="formAuthenticationFilter" />
</map>
</property>
<!-- 过虑器链定义,从上向下顺序执行,一般将/**放在最下边 -->
<property name="filterChainDefinitions">
<value>
<!-- 所有的静态资源要匿名访问 -->
/bootstrap/**=anon
/css/**=anon
/js/**=anon
/static/**=anon
/apply_baoxiao.jsp=perms[baoxiao:apply]
/myBaoxiaoBill=perms[baoxiao:billquery]
/myTaskList=perms[baoxiao:tasklist]
/add_process.jsp=perms[baoxiao:publish]
/processDefinitionList=perms[baoxiao:processlist]
/findUserList=perms[user:query]
/toAddRole=perms[user:create]
<!-- 退出系统 -->
/logout=logout
/**=authc
</value>
</property>
</bean>
<!-- securityManager安全管理器 -->
<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
<property name="realm" ref="customRealm" />
</bean>
<!-- realm -->
<bean id="customRealm" class="com.web.oa.shiro.CustomRealm">
<!-- 将凭证匹配器设置到realm中,realm按照凭证匹配器的要求进行散列 -->
<property name="credentialsMatcher" ref="credentialsMatcher" />
</bean>
<!-- 凭证匹配器 -->
<bean id="credentialsMatcher"
class="org.apache.shiro.authc.credential.HashedCredentialsMatcher">
<property name="hashAlgorithmName" value="md5" />
<property name="hashIterations" value="2" />
</bean>
<bean id="formAuthenticationFilter" class="com.web.oa.shiro.CustomFormAuthenticationFilter">
<!-- 表单中账号的input名称 -->
<property name="usernameParam" value="username" />
<!-- 表单中密码的input名称 -->
<property name="passwordParam" value="password" />
</bean>
</beans>
springmvc基础配置
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
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-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.2.xsd">
<mvc:annotation-driven />
<!--
加了类型转换器,静态资源 使用此种方法解析
它的意思就是没有映射到的URL交给默认的web容器中的servlet进行处理:
-->
<mvc:default-servlet-handler/>
<!-- 扫描controller包 -->
<context:component-scan base-package="com.web.oa.controller"></context:component-scan>
<!-- 视图解析器 -->
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/"></property>
<property name="suffix" value=".jsp"></property>
</bean>
<!--
<bean id="conversionService"
class="org.springframework.format.support.FormattingConversionServiceFactoryBean">
<property name="converters">
<list>
<bean class="cn.web.auction.converter.DateConverter" />
</list>
</property>
</bean>
-->
<!-- 支持文件上传 -->
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="maxUploadSize" value="104857600" />
<property name="maxInMemorySize" value="4096" />
<property name="defaultEncoding" value="UTF-8"></property>
</bean>
</beans>
web配置
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>myoa</display-name>
<!-- 配置前端控制器 -->
<servlet>
<servlet-name>dispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/springmvc.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>dispatcherServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<!-- shiro的filter -->
<!-- shiro过虑器,DelegatingFilterProxy通过代理模式将spring容器中的bean和filter关联起来 -->
<filter>
<filter-name>shiroFilter</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
<!-- 设置true由servlet容器控制filter的生命周期 -->
<init-param>
<param-name>targetFilterLifecycle</param-name>
<param-value>true</param-value>
</init-param>
<!-- 设置spring容器filter的bean id,如果不设置则找与filter-name一致的bean -->
<init-param>
<param-name>targetBeanName</param-name>
<param-value>shiroFilter</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>shiroFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- 配置中文编码的过滤器 -->
<filter>
<filter-name>encoding</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>encoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- 配置加载spring容器的监听器 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- 全局参数: xml文件的路径 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/applicationContext.xml</param-value>
</context-param>
<!-- 默认静态资源映射 -->
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.jpg</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.js</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.css</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.png</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
</web-app>
未引入具体的项目只是进行简单的框架整合,需要根据项目的要求进行增加修改配置;这是原始ssm整合,使用springboot整合ssm的话不用这么多配置文件,使用注释即可达到大部分配置。现在主要使用分布式springcloud+springboot进行前后端分离开发,或使用dubbo+zookeeper+springboot;现在java要学的东西越来越多,继续努力!
文章浏览阅读520次。最近小编开发微信的时候突然会因为一些莫名奇妙的问题所困惑,下面举例说明微信获取关注用户的用户名 经常会有用户的昵称带有emoji特殊表情符号,因为好看帅装逼用嘛,就因为这样给很多微信开发的技术带来了很多不必要的困惑。因为你发现为什么在获取用户时候出现插入用户资料失败等问题?不多说了进行问题解答???第一种方法 后端 php 端过滤emoji 表情符号方法通过正则来过滤emoji表情符号的方法,很..._js emoji2str
文章浏览阅读3.5k次,点赞13次,收藏23次。之前的项目中为了提高效率,避免使用UE功能不完善的UMG系统,使用了WebUI插件,在UI中内嵌浏览器来展示网页。用Vue框架配合插件制作网页还是比UMG要快很多的,毕竟UE的UI制作插件比较少。_ue5 webui
文章浏览阅读927次,点赞18次,收藏11次。有时候他是个对象,在对象里找,可能会找到$children,这个$children是个数组,里面的第一项里有toggleRowSelection属性,所以这种情况下可以改成(这种情况一般都是因为各个公司基于el-table进行了二次封装导致的,所以得在里面慢慢找)注意:row只能是表格的data属性指定的数组中的数据,放其它数组中数据是无效的。(3)在打开弹窗时,需要先让弹窗的visible变为true,再调获取表格数据的接口。(1)row:表格的行数据,选中/取消选中哪行,就是哪行的数据。_el-table弹窗将已选择回显
文章浏览阅读308次,点赞5次,收藏8次。MuLogin让每个eBay账号的登录环境都是真实且自然的,并且每个eBay账号独立运行,有完全独立的cookie、浏览器、IP地址等,互相安全隔离。另外,当我们的一个eBay账号被封,新注册eBay账号更容易存活,不会产生账号关联和IP关联问题,从源头上抑制问题产生。不要害怕联系 eBay,找出你的账户被封的原因,表明你明白错在哪里,并愿意遵守规则,根据平台要求进行整改。2. 在创建 eBay 账户时,确保你的所有信息都正确无误,而且你的银行信息、付款方式也是最新的。_ebay 封号
文章浏览阅读1.5k次,点赞2次,收藏15次。实现图片浏览器用到的知识,包括窗口部件、布局、事件、对象模型与容器类、图形视图、模型/视图编程以及多线程等。大致流程为:首先定义一个图片类,该类包含图片的路径、文件名、文件id以及获取这些变量的函数。然后定义了一个图片数组类,主要包含添加图像以及获取所有图像以及新加入图像的函数。最后通过将图片名字加入到界面左侧QDockWidget部件中的QTreeView中,通过线程将图片的预览加入界面下侧的窗口部件中。最后通过双击可查看完整图片,以及通过滚轮和鼠标等事件来对图片进行一些操作。_qt 实现图片工具
文章浏览阅读525次。CDN加速目前为止是网站加速的标准配置了,同样有用户认为套了CDN网站打开速度就完全解决了,实际上并没有这么简单,需要根据我们网站本身特点去深入分析网站速度的难题在什么地方,才可以对症下药,网站加速的方式方法和手段各种各样,我们需要精确分析问题去处理每个难题。碰到一个打开相对来说有点慢的网站,加速前后左右效果明显,从以前的100s提速的3-4s。1、该网站的难题关键在于网站首页文件尺寸十分的大,约20M,全部都是大尺寸图片。2、外链请求相对比较少。3、服务器按固定带宽计费,服务器的带宽比较有限。_cdn加速能提高多少
文章浏览阅读3.5k次,点赞3次,收藏15次。性能分析:1.种类:基于事件的性能分析 通过收集程序执行过程中的具体事件进行工作,每个调用都会触发,输出数据量大,精度高 def profiler(frame, event, arg): print 'PROFILER: %r %r' %&nb._python 性能分析
文章浏览阅读514次。我在计算机上用以下代码部分编写了一个C程序:uint32_t test = 0x01020304;uint8_t array[4];memcpy(array, &test, 4);printf("%02x %02x %02x %02x",array[0], array[1], array[2], array[3]);它打印04030201,但我希望是01020304。我是否必须得出结论,我..._passing argument 2 of 'memcpy' makes pointer from integer without a cast [-w
文章浏览阅读404次,点赞8次,收藏9次。本文示例由平台演示,是OpenAI的国产替代,效果和OpenAI完全一致,站点内所有模型均可API接入或者直接在站内使用。_gpts可以运用到api
文章浏览阅读5.2k次。table:表格tr:行rowspan:占据行数td列 clospan:占据列数th表头(浏览器默认样式粗体居中)caption标题(浏览器默认样式居中)_h5 table
文章浏览阅读1.7w次,点赞9次,收藏55次。运维人员必须熟悉的运维工具汇总操作系统:Centos,※,Ubuntu,Redhat※,,suse,Freebsd网站服务:nginx※,,apache※,,lighttpd,php※,,tomcat※,,resin※,数据 库:MySQL※,,MariaDB,PostgreSQL,Mysql-proxyDB中间件:maxscale,MyCat,atlas,cobar,amoe..._运维需要学哪些工具
文章浏览阅读2w次。1.问题所在后台采用iframe的方式去写的 当用户点击浏览器的返回上一级就会让页面回到登录页面。2.想要实现效果当用户点击上一级的时候只会让iframe里面的内容去返回上一级而不是整个iframe返回3解决问题方案3.1第一种解决方案首先我想到的是给代码加一个返回上一级按钮轻松实现代码如下<span onclick="back()">返回上一级&..._iframe返回上一页