Servlet mappings are currently configured under
/filters/servlets. Often times, other components in the system need to know about those mappings. A simple example: generating links for the DAM servlet.
Make it possible for arbitrary components to know how/where a servlet is mapped.
- Generating DAM links
- Generating links to Imaging module
- Links to REST APIs
- essentially anything exposed via a Servlet where we need to generate links to.
Such a mapping could be configured in the module's own class - and therefore used by the servlet mapping AND other arbitrary components (URI2RepoMapping, Link API, templating functions, ...)
Introduce a subclass for
ServletDispatchingFilter (which uses a specific impl of
Servlets can still be used with current mechanism, "configured mappings", or with the new one: a developer would need to subclass that new Filter class replacement and implement a getDynamicMapping() method.
This thus allows other components to use the same path, configured in one single place, for different purposes (typically to generate links)
(Where this method would delegate to MyModule.getFooPath(), and MyModule would be @injected in said filter.
Screenshots should be speaking enough:
Current servet mapping:
1) Path (mapping) in the module:
2) Different configuration for the servlet node:
I have a POC working in my local DAM branch.
I would suggest having this (the abstract) in core.
I can update this concept with proposed naming.
Additionally, might make sense to change the package of these new classes (from