Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6831893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:47:30+00:00 2026-05-26T22:47:30+00:00

I am working on a Java application for a while. I primarily work on

  • 0

I am working on a Java application for a while. I primarily work on .NET Platform. Although I feel lot of concepts are common between these two platforms but there are few areas where I am finding some issues related to the configuration.

I am working on Authentication and Authorization and thought I would get something similar to Membership APIs of .NET in JAVA. Closest which I got was using j_security_check. I also got to know about JAAS but think it is little too deep for me to dive into.

I have created the user and role tables in the database and now I have to specify the JDBC Realm settings somewhere. I am using Tomcat 7.0. In most places, it’s mentioned that I need to specify the realm setting in the server.xml.But wouldn’t that apply to all web application deployed on that server since it would become a server level configuration ?.

On a site I even saw a developer mentioning about context.xml but again can’t see a standard document that mention about using this XML file for setting JDBC realm

In.NET, We always put Membership settings at the web.config level and not Machine.config.

Totally Confused on this. Looking for some light on this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:47:31+00:00Added an answer on May 26, 2026 at 10:47 pm

    Why is Realm setting required in Server.xml and not web.xml

    This is not true, you can define it in your webapp as well, but then only in a servletcontainer-specific configuration file, such as /META-INF/context.xml in case of Tomcat. It cannot be definied in /WEB-INF/web.xml because it’s specific to the standard Servlet API, not the servletcontainer implementation.


    But wouldn’t that apply to all web application deployed on that server since it would become a server level configuration ?.

    That’s correct. This is not recommended if you have no control over the server or if you don’t want to publish the realm through other webapps.


    On a site I even saw a developer mentioning about context.xml but again can’t see a standard document that mention about using this XML file for setting JDBC realm

    You can specify it in webapp’s /META-INF/context.xml. See also Tomcat’s own documentation on the <Context> element:

    Defining a context

    It is NOT recommended to place <Context> elements directly in the server.xml file. This is because it makes modifying the Context configuration more invasive since the main conf/server.xml file cannot be reloaded without restarting Tomcat.

    Individual Context elements may be explicitly defined:

    • In an individual file at /META-INF/context.xml inside the application files. Optionally (based on the Host’s copyXML attribute) this may be copied to $CATALINA_BASE/conf/[enginename]/[hostname]/ and renamed to application’s base file name plus a ".xml" extension.

    • In individual files (with a ".xml" extension) in the $CATALINA_BASE/conf/[enginename]/[hostname]/ directory. The context path and version will be derived from the base name of the file (the file name less the .xml extension). This file will always take precedence over any context.xml file packaged in the web application’s META-INF directory.

    • Inside a Host element in the main conf/server.xml.

    (emphasis is not mine, it is already as such in Tomcat’s documentation)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working under java application which uses XSLT transformation. I have a lot
I'm working on a Java application that uses JavaSpace. We're developing this in Eclipse.
So I am working on a java application, and the customer has requested the
I'm working on a java web-application, trying to be xml-friendly and writing my jsp
I am working on a Java/Struts application that uses Tomcat 6.0.10. It's a typical
I'm working on a Java web application (Adobe Flex front-end, JPA/Hibernate/BlazeDS/Spring MVC backend) and
I am working on the I18n of our java application and we have decided
I have a really strange issue. I am working on a Java SWING application
I am working with a large Java web application from a commercial vendor. I've
I'm working on converting a very simple java desktop application to run in java

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.