struts2+spring3+hibernate3+ireport+防止重复登录

1、首先是配置 

      1)web.xml


xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
       

contextConfigLocation

                     
classpath:applicationContext-business.xml

                   
/WEB-INF/applicationContext.xml


               

springSecurityFilterChain

org.springframework.web.filter.DelegatingFilterProxy



springSecurityFilterChain
/*



org.springframework.web.context.ContextLoaderListener




org.springframework.security.web.session.HttpSessionEventPublisher



struts2

org.apache.struts2.dispatcher.FilterDispatcher



struts2
/*


login.jsp


2)struts配置(因为程序中使用了注解,所以这里除了保留报表的配置外,其他全部使用注解处理业务)


    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" 
    "http://struts.apache.org/dtds/struts-2.0.dtd">




/ireport/user.jasper
list
PDF




3)spring配置

1、applicationContext-business.xml


xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/aop     
   http://www.springframework.org/schema/aop/spring-aop-2.5.xsd   
  http://www.springframework.org/schema/beans     
  http://www.springframework.org/schema/beans/spring-beans-2.5.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-2.5.xsd">





class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor">






class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">





bean/User.hbm.xml






org.hibernate.dialect.Oracle9Dialect

true

org.hibernate.connection.C3P0ConnectionProvider
50
50
120
100
120
2
hl3000




class="org.springframework.orm.hibernate3.HibernateTransactionManager">


2、applicationContext.xml


xmlns:beans="http://www.springframework.org/schema/beans"
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/security 
                        http://www.springframework.org/schema/security/spring-security-3.0.xsd">




authentication-failure-url="/login.jsp?error=true"
default-target-url="/main.jsp"
always-use-default-target="true" />



error-if-maximum-exceeded="false" />





users-by-username-query="select username,password,enabled from t_user where username=?"
authorities-by-username-query="select username,role from t_user where username=?" />

                 
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
value="oracle.jdbc.driver.OracleDriver" />
value="jdbc:oracle:thin:@localhost:1521:orcl" />



2、文件位置及jar包(见相册:struts2+spring3+hibernate3+ireport+防止重复登录)

你可能感兴趣的:(struts,spring,hibernate,encoding,user,bean)