Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

Re: [jdom-interest] check if an element exists

Mike Brenner

2007-01-19

Replies:

In this one particular case, you could put the following into
your tomcat/conf/Catalina/localhost/webapp.xml file

    <Realm className="org.apache.catalina.realm.JDBCRealm"
         driverName="com.mysql.jdbc.Driver"
         connectionURL="jdbc:mysql://localhost:3306/cat_wash"
         connectionName="cat_wash"
         connectionPassword="cat_wash"
         userTable="users_cat_wash"
         userNameCol="cat_wash_admin"
         userCredCol="cat_wash_password"
         userRoleTable="users_cat_wash_roles"
         roleNameCol="role"
         digest="SHA"/>

The tomcat will look up the user id and role automatically.



Ernesto Reig wrote:
> What could be the easiest way to check if a certain username exists?
> I have an xml like this:
>
> <tomcat-users>
>   <role rolename="tomcat"/>
>   <role rolename="role1"/>
>   <role rolename="manager"/>
>   <user username="tomcat" password="tomcat" roles="tomcat"/>
>   <user username="both" password="tomcat" roles="tomcat,role1"/>
>   <user username="role1" password="tomcat" roles="role1"/>
> </tomcat-users>
>
> When it comes to check if a certain user with a certain username exists,
> I don know an easy way to do that. Can someone help? Thnx.


_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.