StaticWebApplicationContext wac = prepareWebApplicationContext();
((MockServletContext) wac.getServletContext()).addInitParameter(
Config.FMT_LOCALIZATION_CONTEXT, "org/springframework/web/context/WEB-INF/context-messages");
InternalResourceViewResolver irvr = new InternalResourceViewResolver();
irvr.setApplicationContext(wac);
irvr.setViewClass(TilesJstlView.class);
View view = irvr.resolveViewName("testTile", new Locale("nl", ""));
MockHttpServletRequest request = new MockHttpServletRequest(wac.getServletContext());
MockHttpServletResponse response = new MockHttpServletResponse();
wac.addMessage("code1", locale, "messageX");
request.setAttribute(DispatcherServlet.WEB_APPLICATION_CONTEXT_ATTRIBUTE, wac);