This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
hello all, has anybody an idea how i can access the MessageRessources in a Taglib ? tia andreas spiessl
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
Hi You can do it the dirty way: private static MessageResources messages = MessageResources.getMessageResources("lae.resources.ApplicationResources");
the complex way: private static MessageResources messages; protected MessageResources getResources() { if (messages == null) { ActionMappings mappings; mappings = (ActionMappings) pageContext.getAttribute(Action.MAPPINGS_KEY , PageContext.APPLICATION_SCOPE); ActionServlet servlet = mappings.getServlet(); messages = servlet.getResources(); } return messages; } or perhaps there is a nicer way to get the resources without knowing the name of the resource file. Andr�