Struts modules
Struts modules are fully supported. The Calyxo Struts component provides the StrutsModuleContext module context implementation. This class supports URL prefix- as well as extension-mapped modules.
Here are the relevant details of the Struts module context implementation:
- getName() answers the module prefix, which is the empty string for the default module and a string starting with a slash ("/") for other modules.
- getInitParameter(String name) simply answers the servlet configuration's init parameter for the given name.
- getPath(String action) answers a context-relative path for the specified action mapping path. The action may have a query and/or anchor appended.
- Module scope is simulated by mapping key "<k>" to attribute "<k><p>" in application scope, where <p> is the module prefix. Thus, module.getAttribute("foo") is equivalent to module.getServletContext().getAttribute("foo" + module.getName()).
The module scope doesn't prevent conflicts to application scope. In particular, module scope and application scope are the same in the default module. The reason we implemented it this way is that Struts uses the same mapping strategy to save module-related stuff, e.g. message resources and configuration data.


