/** * Overrides {@code VelocityView.checkTemplate()} to additionally check * that both the layout template and the screen content template can be loaded. * Note that during rendering of the screen content, the layout template * can be changed which may invalidate any early checking done here. */ @Override public boolean checkResource(Locale locale) throws Exception { if (!super.checkResource(locale)) { return false; } try { // Check that we can get the template, even if we might subsequently get it again. getTemplate(this.layoutUrl); return true; } catch (ResourceNotFoundException ex) { throw new NestedIOException("Cannot find Velocity template for URL [" + this.layoutUrl + "]: Did you specify the correct resource loader path?", ex); } catch (Exception ex) { throw new NestedIOException( "Could not load Velocity template for URL [" + this.layoutUrl + "]", ex); } }
/** * Overrides {@code VelocityView.checkTemplate()} to additionally check * that both the layout template and the screen content template can be loaded. * Note that during rendering of the screen content, the layout template * can be changed which may invalidate any early checking done here. */ @Override public boolean checkResource(Locale locale) throws Exception { if (!super.checkResource(locale)) { return false; } try { // Check that we can get the template, even if we might subsequently get it again. getTemplate(this.layoutUrl); return true; } catch (ResourceNotFoundException ex) { throw new NestedIOException("Cannot find Velocity template for URL [" + this.layoutUrl + "]: Did you specify the correct resource loader path?", ex); } catch (Exception ex) { throw new NestedIOException( "Could not load Velocity template for URL [" + this.layoutUrl + "]", ex); } }
/** * Overrides {@code VelocityView.checkTemplate()} to additionally check * that both the layout template and the screen content template can be loaded. * Note that during rendering of the screen content, the layout template * can be changed which may invalidate any early checking done here. */ @Override public boolean checkResource(Locale locale) throws Exception { if (!super.checkResource(locale)) { return false; } try { // Check that we can get the template, even if we might subsequently get it again. getTemplate(this.layoutUrl); return true; } catch (ResourceNotFoundException ex) { throw new NestedIOException("Cannot find Velocity template for URL [" + this.layoutUrl + "]: Did you specify the correct resource loader path?", ex); } catch (Exception ex) { throw new NestedIOException( "Could not load Velocity template for URL [" + this.layoutUrl + "]", ex); } }