From d9a446406ecf91e83d4ef7ac848213a42cefd46c Mon Sep 17 00:00:00 2001 From: shaper Date: Thu, 2 May 2002 21:41:54 +0000 Subject: [PATCH] Fail gracefully and report an informative error message if INIT_PROPS_KEY is unspecified in the servlet config. git-svn-id: https://samskivert.googlecode.com/svn/trunk@728 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../java/com/samskivert/velocity/DispatcherServlet.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/projects/samskivert/src/java/com/samskivert/velocity/DispatcherServlet.java b/projects/samskivert/src/java/com/samskivert/velocity/DispatcherServlet.java index 474a50cd..12382796 100644 --- a/projects/samskivert/src/java/com/samskivert/velocity/DispatcherServlet.java +++ b/projects/samskivert/src/java/com/samskivert/velocity/DispatcherServlet.java @@ -1,5 +1,5 @@ // -// $Id: DispatcherServlet.java,v 1.17 2002/05/02 07:20:04 mdb Exp $ +// $Id: DispatcherServlet.java,v 1.18 2002/05/02 21:41:54 shaper Exp $ // // samskivert library - useful routines for java programs // Copyright (C) 2001 Michael Bayne @@ -192,6 +192,12 @@ public class DispatcherServlet extends VelocityServlet throws IOException { String propsPath = config.getInitParameter(INIT_PROPS_KEY); + if (propsPath == null) { + throw new IOException(INIT_PROPS_KEY + " must point to " + + "the velocity properties file in " + + "the servlet configuration."); + } + // config util loads properties files from the classpath Properties props = ConfigUtil.loadProperties(propsPath);