Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[servlet-dev] Standardise servlet/application context Id?

Hi,

Quite a number of Servlet containers use some way to identify a particular application (war) running on it. This id is used internally, but also externally, for instance to authentication and authorization modules to keep track of which application they are installed for.

For authentication for instance we defined this Id for an application:

String getAppContextID(ServletContext context)
 return context.getVirtualServerName() + " " + context.getContextPath();
}

While this is simple enough to create, it's somewhat tedious, but also something that differs between containers and libraries that want such an Id.

Would it be an idea to standardise this in Servlet, to exist next to getServletName?

E.g.

/**
     * Returns the unique Id of this web application corresponding to this
     * ServletContext.
     *
*/
String ServletContext#getServletContextId();

Thoughts?

Kind regards,
Arjan Tijms



Back to the top