To deliver static files that are part of the application brasato offers one concept:
The first mechanism is used to embedd general framework resources, e.g.
css files, themes and basic javascript files. Those files are normally
embedded directly in body.html. Those files are deliverd using the
StaticMediaDispatcher
class.
While the delivery of static resources via the dispatchers described above is a service infrastructure of the framework, the mapper comes in place when you want to have control over the delivery process (e.g a protected resource) or the delivered files are generated on the fly (e.g. an excel file download).
Mappers must be registered using the mapper registry or the global mapper registry. The difference between global and normal is that globals mappers have a global mapper name based on the class that registered for the mapper. Thus, the global mapper will always have the same URL and can be cached by the browser. Global mappers are shared between all users. Make sure you implement a proper last-modified in the resources you deliver via global mappers!
The normal mapper registry registers for user session based mappers. The life-time of such mappers is bound to the user session.
Make sure you unregister the mappers you register. Use the BasicController to work with mappers and use the convenience methods there to register mappers
Note that global mappers don't need to be unregistered. They are registered only once in a class and cleaned up when the applicatoin shuts down.