Author: heiko.braun(a)jboss.com
Date: 2008-04-07 10:13:02 -0400 (Mon, 07 Apr 2008)
New Revision: 6254
Modified:
framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/transport/HttpListenerRef.java
Log:
Be more releaxed when creating HttpListenerRef
Modified:
framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/transport/HttpListenerRef.java
===================================================================
---
framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/transport/HttpListenerRef.java 2008-04-07
14:12:17 UTC (rev 6253)
+++
framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/transport/HttpListenerRef.java 2008-04-07
14:13:02 UTC (rev 6254)
@@ -37,8 +37,11 @@
public HttpListenerRef(String webContext, String urlPattern, URI address)
{
- if(!webContext.startsWith("/") || !urlPattern.startsWith("/"))
- throw new IllegalArgumentException("Both webContext and urlPattern need to
start with '/'");
+ if(!webContext.startsWith("/"))
+ webContext = "/"+webContext;
+
+ if(!urlPattern.startsWith("/"))
+ urlPattern = "/"+urlPattern;
this.webContext = webContext;
this.urlPattern = urlPattern;
@@ -59,4 +62,10 @@
{
return this.webContext+this.urlPattern;
}
+
+
+ public String toString()
+ {
+ return getAddress().toString();
+ }
}