Results 1 to 2 of 2
  1. #1
    Eric is offline Senior Member
    Join Date
    Jun 2007
    Posts
    111
    Rep Power
    0

    Default Accounts of users

    I want to make a page Web with accounts of users, in which the users can be registered and login, does somebody can guide to me?, how can I do that?

    I did it that: when somebody does login I pay attention to the data base if that person already registered, I do session=req.getSession (true); and I keep like attribute from session the user's name. The problem is when other user does login, the page shows the first user's account.

    Eric

  2. #2
    Albert is offline Senior Member
    Join Date
    Jun 2007
    Posts
    114
    Rep Power
    0

    Default RE: Accounts of users

    if you use tomcat, attached the security of your project to this. you only must modify server.xml

    Java Code:
    <Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99" 
                 driverName="org.postgresql.Driver" 
              connectionURL="jdbc: postgresql://10.0.0.1:5432/DB" 
             connectionName="USER_DB" connectionPassword="PASSWORD_DB" 
                  userTable="TABLE_USERS" userNameCol="FIELD_USER" userCredCol="FIELD_PASSWORD"  
              userRoleTable="TABLE_ROLLS" roleNameCol="FIELD_ROLL" />
    and in the web.xml

    Java Code:
    <login-config> 
            <auth-method>FORM</auth-method> 
            <realm-name>MyFirst Protected Area</realm-name> 
            <form-login-config> 
                    <form-login-page>/PAGE_LOGIN</form-login-page>  
                    <form-error-page>/PAGIE_LOGIN_ERROR</form-error-page> 
            </form-login-config> 
     </login-config>
    
    <security-role> 
             <role-name>ROLLS_THA_ACEPT_THE_SYSTEM</role-name> 
     </security-role>
    Albert:rolleyes:

Similar Threads

  1. Multiple Users
    By peiceonly in forum Threads and Synchronization
    Replies: 5
    Last Post: 06-09-2008, 10:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •