On 20/05/2008 15:31, Carol Cheung wrote the following:

Hi,

Here's a part of my web.xml:

 <security-role>
   <description>user</description>
   <role-name>user</role-name>
 </security-role>

  <!-- Login Authentication -->
  <security-constraint>
    <display-name>Secure User Pages</display-name>
    <web-resource-collection>
      <web-resource-name>SecureUserPages</web-resource-name>
      <url-pattern>/index.jsp</url-pattern>
      <url-pattern>/welcome.jsp</url-pattern>
    </web-resource-collection>
    <auth-constraint>
        <description>user</description>
        <role-name>user</role-name>
    </auth-constraint>
  </security-constraint>

  <login-config>
    <auth-method>FORM</auth-method>
    <form-login-config>
      <form-login-page>/login.jsp</form-login-page>
      <form-error-page>/loginError.jsp</form-error-page>
    </form-login-config>
  </login-config>

Inside the Engine element of server.xml, I have:

      <Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
             driverName="org.postgresql.Driver"
      connectionURL="jdbc:postgresql://localhost:5432/thedb?user=theuser
&amp;password=thepw"
                 digest="MD5"
userTable="users" userNameCol="username" userCredCol="password"
          userRoleTable="user_roles" roleNameCol="rolename" />

The Connector element in server.xml:
<Connector port="8888"
...

The URL is
http://hostname:8888/appname/jsp/welcome.jsp

(For reasons of confidentiality, I had to replace the name of the database with "thedb", user with "theuser", password with "thepw", host with "hostname", application name with "appname" before posting. Please let me know if this poses a problem.)

Thanks in advance,
CC


Hi,

Thanks Christopher Schultz for pointing out my error: the url pattern should be /jsp/welcome.jsp.

Now, I'm able to see login.jsp when requesting welcome.jsp.
If I enter an incorrect login/password combination, I get taken to (correctly) loginError.jsp But if I enter a correct login/password combination, I get a refreshed login.jsp page (form fields are cleared), instead of being taken to welcome.jsp

Your help is appreciated,
CC

---------------------------------------------------------------------
To start a new topic, e-mail: [email protected]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to