Skip to main content

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

I do see some value in this as unique id for a context is useful in many places (temp file location, session stores, logging etc.).   
However, I'm keen to have the makeup of the idea fixed, as different containers may have different criteria to make a context unique - it may be that some containers even have multiple versions of the same context running during a graceful upgrade.   Thus it should only specify that the id is unique within the server (or cluster?)

I'd certainly consider a PR.

cheers




On Sat, 28 Sep 2019 at 01:47, arjan tijms <arjan.tijms@xxxxxxxxx> wrote:
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


_______________________________________________
servlet-dev mailing list
servlet-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/servlet-dev


--

Back to the top