Discussions

General J2EE: Configuration files

  1. Configuration files (3 messages)

    Hi,
    How many types of configuration files are there for a webapplication and what r they?

    Can we access the Servlet Context of pne Application from another?

    thanks & regards
    Santhosh

    Threaded Messages (3)

  2. Configuration files[ Go to top ]

    web.xml only. If you use any framework, you need to have the framework specific files.

    I don't think you can access another web application's servlet context, because ServletConfig.getServletContext() method will return the current web applications context only.
  3. Configuration files[ Go to top ]

    Actually, you can access another ServletContext, by using the getContext() method of the current Servlet Context, and the context path of the other web application:

    String other_context_path = ...
    ServletContext thisContext = getServletContext();
    ServletContext otherContext = thisContext.getContext(other_context_path);
  4. Configuration files[ Go to top ]

    Thanks, I didn't know that before.