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?

Personally I don't think this is worth it. 

This is not something that the majority of end users will need to interact with as far as I can tell, so I don't think it is appropriate to add a method to the Servlet API that can be easily replicated via a single line static utility method when it will likely only be used by a small number of frameworks. 

Stuart

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