/** * Sets the specified messages resources as a servlet context * attribute using the specified key and the module config prefix. * You can use this method, if your action calls * <code>Action.getResources(HttpServletRequest, String)</code>. * Please note that the {@link com.mockrunner.mock.web.MockModuleConfig} * is set by Mockrunner as the current module. It has the name <i>testmodule</i>. * This can be changed with <code>ModuleConfig.setPrefix</code>. * @param key the key of the messages resources * @param resources the messages resources */ public void setResources(String key, MessageResources resources) { MessageResourcesConfig config = new MessageResourcesConfig(); config.setKey(key); mockFactory.getMockModuleConfig().addMessageResourcesConfig(config); key = key + mockFactory.getMockModuleConfig().getPrefix(); mockFactory.getMockServletContext().setAttribute(key, resources); }
/** * Sets the specified messages resources as a servlet context * attribute using the specified key and the module config prefix. * You can use this method, if your action calls * <code>Action.getResources(HttpServletRequest, String)</code>. * Please note that the {@link com.mockrunner.mock.web.MockModuleConfig} * is set by Mockrunner as the current module. It has the name <i>testmodule</i>. * This can be changed with <code>ModuleConfig.setPrefix</code>. * @param key the key of the messages resources * @param resources the messages resources */ public void setResources(String key, MessageResources resources) { MessageResourcesConfig config = new MessageResourcesConfig(); config.setKey(key); mockFactory.getMockModuleConfig().addMessageResourcesConfig(config); key = key + mockFactory.getMockModuleConfig().getPrefix(); mockFactory.getMockServletContext().setAttribute(key, resources); }
/** * Sets the specified messages resources as a servlet context * attribute using the specified key and the module config prefix. * You can use this method, if your action calls * <code>Action.getResources(HttpServletRequest, String)</code>. * Please note that the {@link com.mockrunner.mock.web.MockModuleConfig} * is set by Mockrunner as the current module. It has the name <i>testmodule</i>. * This can be changed with <code>ModuleConfig.setPrefix</code>. * @param key the key of the messages resources * @param resources the messages resources */ public void setResources(String key, MessageResources resources) { MessageResourcesConfig config = new MessageResourcesConfig(); config.setKey(key); mockFactory.getMockModuleConfig().addMessageResourcesConfig(config); key = key + mockFactory.getMockModuleConfig().getPrefix(); mockFactory.getMockServletContext().setAttribute(key, resources); }