[Httpunit-commit] CVS: httpunit/src/com/meterware/servletunit WebApplication.java,1.18,1.19
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2003-02-27 13:33:51
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/servletunit
In directory sc8-pr-cvs1:/tmp/cvs-serv3587/src/com/meterware/servletunit
Modified Files:
WebApplication.java
Log Message:
Verify that the context parameter starts with '/'
Index: WebApplication.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/servletunit/WebApplication.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- WebApplication.java 19 Feb 2003 19:17:58 -0000 1.18
+++ WebApplication.java 27 Feb 2003 13:33:45 -0000 1.19
@@ -109,6 +109,7 @@
* Constructs an application spec from an XML document.
*/
WebApplication( Document document, File file, String contextPath ) throws MalformedURLException, SAXException {
+ if (contextPath != null && contextPath.length() > 0 && !contextPath.startsWith( "/" )) throw new IllegalArgumentException( "Context path " + contextPath + " must start with '/'" );
_contextDir = file;
_contextPath = contextPath == null ? "" : contextPath;
registerServlets( document );
|