此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
楼主【xiaoao808】截止到2008-07-22 05:02:07的历史汇总数据(不包括此帖):
发帖的总数量:0                        发帖的总分数:0                        每贴平均分数:0                        
回帖的总数量:1                        得分贴总数量:0                        回帖的得分率:0%                       
结贴的总数量:0                        结贴的总分数:0                        
无满意结贴数:0                        无满意结贴分:0                        
未结的帖子数:0                        未结的总分数:0                        
结贴的百分比:---------------------结分的百分比:---------------------
无满意结贴率:---------------------无满意结分率:---------------------
如何结贴请参考这里:http://topic.csdn.net/u/20080501/09/ef7ba1b3-6466-49f6-9d92-36fe6d471dd1.html

解决方案 »

  1.   

    配置:
    applicationContext-security.xml如下
    <?xml version="1.0" encoding="UTF-8"?><beans:beans xmlns="http://www.springframework.org/schema/security"
    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-2.5.xsd
                  http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.4.xsd"> <http auto-config="true">
    <concurrent-session-control max-sessions="1" exception-if-maximum-exceeded="true" />

    <intercept-url pattern="/" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
    <intercept-url pattern="/login.jsp" access="IS_AUTHENTICATED_ANONYMOUSLY"/> 
    <intercept-url pattern="/**" access="ROLE_USER"/>
    <form-login login-page="/login.jsp" default-target-url="/index.jsp" authentication-failure-url="/login.jsp?login_error=1"/>
            <logout logout-success-url="/login.jsp"/>
    </http>
    <authentication-provider>
    <jdbc-user-service data-source-ref="dataSource"
    users-by-username-query="SELECT username, password, enabled FROM sys_user where username=?" 
    authorities-by-username-query="SELECT username, authority from sys_roles WHERE username=?"/>

    </authentication-provider>

    <beans:bean id="loggerListener" class="org.springframework.security.event.authentication.LoggerListener"/></beans:beans>
    web.xml 如下
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee   http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/config/faces-config.xml</param-value>
    </context-param>
    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
    /WEB-INF/config/applicationContext.xml,
    /WEB-INF/config/applicationContext-security.xml
    </param-value>
    </context-param> <filter>
    <filter-name>Spring character encoding filter</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>Spring character encoding filter</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    <listener>
    <listener-class>
    org.springframework.web.context.ContextLoaderListener
    </listener-class>
    </listener> <listener>
    <listener-class>
    org.springframework.security.ui.session.HttpSessionEventPublisher
    </listener-class>
    </listener>
    <filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>
    org.springframework.web.filter.DelegatingFilterProxy
    </filter-class>
    </filter> <filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping> <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>0</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
    <welcome-file>login.jsp</welcome-file>
    </welcome-file-list>
    </web-app>
    数据库,不必要的信息自己删除哟!prompt PL/SQL Developer import file
    prompt Created on 2008年10月22日 by Administrator
    set feedback off
    set define off
    prompt Dropping PROJECT...
    drop table PROJECT cascade constraints;
    prompt Dropping SYS_PERMISSIONS...
    drop table SYS_PERMISSIONS cascade constraints;
    prompt Dropping SYS_RESOURCES...
    drop table SYS_RESOURCES cascade constraints;
    prompt Dropping SYS_ROLES...
    drop table SYS_ROLES cascade constraints;
    prompt Dropping SYS_USER...
    drop table SYS_USER cascade constraints;
    prompt Creating PROJECT...
    create table PROJECT
    (
      PROID      VARCHAR2(50) not null,
      PRONAME    VARCHAR2(100),
      MANAGER    VARCHAR2(10),
      SIGNEDDATE DATE,
      STARTDATE  DATE,
      STOPDATE   DATE,
      AMOUNT     NUMBER(13,2),
      BALANCE    NUMBER(13,2),
      STATE      VARCHAR2(10)
    )
    tablespace USERS
      pctfree 10
      initrans 1
      maxtrans 255
      storage
      (
        initial 64K
        minextents 1
        maxextents unlimited
      );
    alter table PROJECT
      add constraint PK_PRO primary key (PROID)
      using index 
      tablespace USERS
      pctfree 10
      initrans 2
      maxtrans 255
      storage
      (
        initial 64K
        minextents 1
        maxextents unlimited
      );prompt Creating SYS_PERMISSIONS...
    create table SYS_PERMISSIONS
    (
      ID        VARCHAR2(50) not null,
      NAME      VARCHAR2(50),
      DESCN     VARCHAR2(50),
      OPERATION VARCHAR2(50),
      STATUS    VARCHAR2(50)
    )
    tablespace USERS
      pctfree 10
      initrans 1
      maxtrans 255
      storage
      (
        initial 64K
        minextents 1
        maxextents unlimited
      );prompt Creating SYS_RESOURCES...
    create table SYS_RESOURCES
    (
      ID         VARCHAR2(50) not null,
      NAME       VARCHAR2(50),
      RES_TYPE   VARCHAR2(50),
      RES_STRING VARCHAR2(50),
      DESCN      VARCHAR2(50)
    )
    tablespace USERS
      pctfree 10
      initrans 1
      maxtrans 255
      storage
      (
        initial 64K
        minextents 1
        maxextents unlimited
      );prompt Creating SYS_ROLES...
    create table SYS_ROLES
    (
      USERNAME  VARCHAR2(50) not null,
      AUTHORITY VARCHAR2(100),
      DESCN     VARCHAR2(100)
    )
    tablespace USERS
      pctfree 10
      initrans 1
      maxtrans 255
      storage
      (
        initial 64K
        minextents 1
        maxextents unlimited
      );prompt Creating SYS_USER...
    create table SYS_USER
    (
      ID       VARCHAR2(100) not null,
      USERNAME VARCHAR2(50) not null,
      PASSWORD VARCHAR2(100),
      ENABLED  VARCHAR2(10)
    )
    tablespace USERS
      pctfree 10
      initrans 1
      maxtrans 255
      storage
      (
        initial 64K
        minextents 1
        maxextents unlimited
      );
    alter table SYS_USER
      add constraint PK_USER primary key (ID)
      using index 
      tablespace USERS
      pctfree 10
      initrans 2
      maxtrans 255
      storage
      (
        initial 64K
        minextents 1
        maxextents unlimited
      );prompt Disabling triggers for PROJECT...
    alter table PROJECT disable all triggers;
    prompt Disabling triggers for SYS_PERMISSIONS...
    alter table SYS_PERMISSIONS disable all triggers;
    prompt Disabling triggers for SYS_RESOURCES...
    alter table SYS_RESOURCES disable all triggers;
    prompt Disabling triggers for SYS_ROLES...
    alter table SYS_ROLES disable all triggers;
    prompt Disabling triggers for SYS_USER...
    alter table SYS_USER disable all triggers;
    prompt Loading PROJECT...commit;
    prompt 13 records loaded
    prompt Loading SYS_PERMISSIONS...
    prompt Table is empty
    prompt Loading SYS_RESOURCES...
    prompt Table is empty
    prompt Loading SYS_ROLES...
    insert into SYS_ROLES (USERNAME, AUTHORITY, DESCN)
    values ('admin', 'ROLE_USER', null);
    commit;
    prompt 1 records loaded
    prompt Loading SYS_USER...
    insert into SYS_USER (ID, USERNAME, PASSWORD, ENABLED)
    values ('10001', 'admin', '/', '1');
    commit;
    prompt 1 records loaded
    prompt Enabling triggers for PROJECT...
    alter table PROJECT enable all triggers;
    prompt Enabling triggers for SYS_PERMISSIONS...
    alter table SYS_PERMISSIONS enable all triggers;
    prompt Enabling triggers for SYS_RESOURCES...
    alter table SYS_RESOURCES enable all triggers;
    prompt Enabling triggers for SYS_ROLES...
    alter table SYS_ROLES enable all triggers;
    prompt Enabling triggers for SYS_USER...
    alter table SYS_USER enable all triggers;
    set feedback on
    set define on
    prompt Done.
      

  2.   

    http://download.csdn.net/source/3283687