This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Tomcat and the fly likes Need help to read JNDIRealm inforamtion from my application.xml file in Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Need help to read JNDIRealm inforamtion from my application.xml file in Tomcat" Watch "Need help to read JNDIRealm inforamtion from my application.xml file in Tomcat" New topic
Author

Need help to read JNDIRealm inforamtion from my application.xml file in Tomcat

chandra yalla
Greenhorn

Joined: Aug 02, 2005
Posts: 3
Hi,

Can any one tell me , how can i read information related to LAP from realm in Servlets

give below is my realm information related Lap configuration in admin.xml file which is placed in location Tomcat5.0\conf\Catalina\localhost


<Context path="/museadmin" debug="0" privileged="true">

<Realm className="org.apache.catalina.realm.JNDIRealm"
debug="99"
connectionName="cn=manager,dc=Evolium,dc=com"
connectionPassword="secret"
connectionURL="ldap://localhost:391"
roleBase="ou=Groups,ou=OMC,dc=Evolium,dc=com"
roleName="cn"
roleSearch="(uniqueMember={0})"
roleSubtree="false"
userSearch="(cn={0})"
userPassword="userPassword"
userPattern="cn={0},ou=People,ou=OMC,dc=Evolium,dc=com"
/>

</Context>

i need to fetch the connectionURL,connectionPassword etc from above file in the Servlet to make a query to the LDAP.

i am will be very much thankfull if any one can give me some sample Java Code to how to access information from Realm tag in configuration file.

Thanks and Regards
Chandra
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Have you read this?:
http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
chandra yalla
Greenhorn

Joined: Aug 02, 2005
Posts: 3
i have read the tomcat document , it says about how to configure the LDAP information , my problem is how to read that information from Server Code in my webapplication ( i have already configured that information which is working properly for authentication)
 
 
subject: Need help to read JNDIRealm inforamtion from my application.xml file in Tomcat