In a JSP, I want part of the content to be module dependent. How do I test the current module?
A:
There is a method in ModuleUtils called getModuleName. You can use it in a scriptlet or create a separate tag for that.
Superfilin
2009-09-08 20:07:43
nope, it doesn't work.I have two modules sharing tiles (JSPs). If I test the module using <%request.setAttribute("currentModuleName", ModuleUtils.getInstance().getModuleName(request, pageContext.getServletContext()));%>in a jsp stored in /pages/bla/page.jsp, the module is identified as "" (the test is done on the request.getServletPath() by ModuleUtils, so it doesn't get me the current running module.
brisssou
2009-09-09 13:39:22
A:
ModuleUtils.getInstance().getModuleConfig(request, application).getPrefix()
does just what I wanted.
brisssou
2009-09-09 14:29:10