users@glassfish.java.net

Need clarification on JDBCRealm

From: <glassfish_at_javadesktop.org>
Date: Sat, 17 Feb 2007 12:09:55 PST

I'm trying to setup my JDBCRealm this time using a different tutorial:

http://blogs.sun.com/swchan/entry/jdbcrealm_in_glassfish



I've gotten to step 3 but there's no details to help me do this correctly.
I'm setting up a WAR so I'm assuming I'm supposed to put this information into my web.xml.

What exactly do I put in web.xml?

Further reading through J2EE turorials: I've come up with something I ?Think? would go in web.xml. But again I'm uncertain.


--------------------web.xml snippet----------------------
<resource-ref>
  <res-ref-name>jdbc/TriadDB</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>
</resource-ref>

 <security-constraint>
          <display-name>SecurityConstraint</display-name>
          <web-resource-collection>
               <web-resource-name>WRCollection</web-resource-name>
               <url-pattern>/*</url-pattern>
          </web-resource-collection>
          <auth-constraint>
                <role-name>loginUser</role-name>
          </auth-constraint>
          <user-data-constraint>
                <transport-guarantee>NONE</transport-guarantee>
          </user-data-constraint>
     </security-constraint>
     
     <login-config>
          <auth-method>BASIC</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>
 
      <security-role>
          <role-name>loginUser</role-name>
     </security-role>

--------------------END web.xml snippet----------------------

The jdbc connection works on other pieces of my app.

I've posted my steps so far at:
http://picasaweb.google.com/codingJoe/JdbcRealmTake2

[b]Questions:[/b]

What is WRCollection?

Why loginUser for role if I already have a role table? Seems to be not applicable.

So expert advice?

What should my web.xml contain? for a JDBCRealm?
What should my sun-web.xml contain?
[Message sent by forum member 'tmonteit' (tmonteit)]

http://forums.java.net/jive/thread.jspa?messageID=204178