response.setContentType(getContentType()); if (logger.isDebugEnabled()) { logger.debug("Including [" + getUrl() + "]");
response.setContentType(getContentType()); if (logger.isDebugEnabled()) { logger.debug("Including [" + getUrl() + "]");
@Test public void debugViewEnglish() throws Exception { View v = rb.resolveViewName("debugView", Locale.ENGLISH); assertThat(v, instanceOf(InternalResourceView.class)); InternalResourceView jv = (InternalResourceView) v; assertEquals("debugView must have correct URL", "jsp/debug/debug.jsp", jv.getUrl()); Map<String, Object> m = jv.getStaticAttributes(); assertEquals("Must have 2 static attributes", 2, m.size()); assertEquals("attribute foo", "bar", m.get("foo")); assertEquals("attribute postcode", "SE10 9JY", m.get("postcode")); assertEquals("Correct default content type", AbstractView.DEFAULT_CONTENT_TYPE, jv.getContentType()); }
@Test public void debugViewFrench() throws Exception { View v = rb.resolveViewName("debugView", Locale.FRENCH); assertThat(v, instanceOf(InternalResourceView.class)); InternalResourceView jv = (InternalResourceView) v; assertEquals("French debugView must have correct URL", "jsp/debug/deboug.jsp", jv.getUrl()); assertEquals("Correct overridden (XML) content type", "text/xml;charset=ISO-8859-1", jv.getContentType()); }
assertEquals("Correct view class", JstlView.class, view.getClass()); assertEquals("Correct URL", "example1", ((InternalResourceView) view).getUrl()); assertEquals("Correct textContentType", "myContentType", ((InternalResourceView) view).getContentType()); assertEquals("Correct textContentType", "myContentType", ((InternalResourceView) view).getContentType());
@Test public void eagerInitialization() throws Exception { ResourceBundleViewResolver rb = new ResourceBundleViewResolver(); rb.setBasename(PROPS_FILE); rb.setCache(getCache()); rb.setDefaultParentView("testParent"); rb.setLocalesToInitialize(new Locale[] {Locale.ENGLISH, Locale.FRENCH}); rb.setApplicationContext(wac); View v = rb.resolveViewName("debugView", Locale.FRENCH); assertThat(v, instanceOf(InternalResourceView.class)); InternalResourceView jv = (InternalResourceView) v; assertEquals("French debugView must have correct URL", "jsp/debug/deboug.jsp", jv.getUrl()); assertEquals("Correct overridden (XML) content type", "text/xml;charset=ISO-8859-1", jv.getContentType()); }
response.setContentType(getContentType()); if (logger.isDebugEnabled()) { logger.debug("Including resource [" + getUrl() + "] in InternalResourceView '" + getBeanName() + "'");