public class UrlBindingConflictException extends StripesRuntimeException
This exception indicates that a URL does not contain enough information to map it to a single
ActionBean
class. In some cases, a URL may match more than one URL binding.
For example, suppose you have two ActionBeans with the URL bindings /foo/{param}/bar
and /foo/{param}/blah
. The paths /foo
and /foo/X
-- while legal,
since any number of parameters or literals may be omitted from the end of a clean URL -- match
both of the URL bindings. Since Stripes cannot determine from the URL the ActionBean to which to
dispatch the request, it throws this exception to indicate the conflict.
Constructor and Description |
---|
UrlBindingConflictException(java.lang.Class<? extends ActionBean> targetClass,
java.lang.String path,
java.util.Collection<java.lang.String> matches)
New exception indicating that the
path does not map to a single ActionBean because it
potentially matches all the URL bindings in the matches collection. |
UrlBindingConflictException(java.lang.String message,
java.lang.Class<? extends ActionBean> targetClass,
java.lang.String path,
java.util.Collection<java.lang.String> matches)
New exception indicating that the
path does not map to a single ActionBean because it
potentially matches all the URL bindings in the matches collection. |
UrlBindingConflictException(java.lang.String path,
java.util.Collection<java.lang.String> matches)
New exception indicating that the
path does not map to a single ActionBean because it
potentially matches all the URL bindings in the matches collection. |
UrlBindingConflictException(java.lang.String message,
java.lang.String path,
java.util.Collection<java.lang.String> matches)
New exception indicating that the
path does not map to a single ActionBean because it
potentially matches all the URL bindings in the matches collection. |
Modifier and Type | Method and Description |
---|---|
java.util.Collection<java.lang.String> |
getMatches()
Get all the URL bindings on existing ActionBeans that match the path
|
protected static java.lang.String |
getMessage(java.lang.Class<? extends ActionBean> targetClass,
java.lang.String path,
java.util.Collection<java.lang.String> matches)
Generate the message to pass to the superclass constructor
|
java.lang.String |
getPath()
Get the path that failed to map to a single ActionBean
|
java.lang.Class<? extends ActionBean> |
getTargetClass()
Get the
ActionBean class for which a URL was being generated when this exception was
thrown. |
public UrlBindingConflictException(java.lang.String message, java.lang.Class<? extends ActionBean> targetClass, java.lang.String path, java.util.Collection<java.lang.String> matches)
path
does not map to a single ActionBean because it
potentially matches all the URL bindings in the matches
collection.message
- An informative message about what went wrongtargetClass
- The class for which a URL could not be generated.path
- The offending pathmatches
- A collection of all the potentially matching URL bindingspublic UrlBindingConflictException(java.lang.Class<? extends ActionBean> targetClass, java.lang.String path, java.util.Collection<java.lang.String> matches)
path
does not map to a single ActionBean because it
potentially matches all the URL bindings in the matches
collection.targetClass
- The class for which a URL could not be generated.path
- The offending pathmatches
- A collection of all the potentially matching URL bindingspublic UrlBindingConflictException(java.lang.String message, java.lang.String path, java.util.Collection<java.lang.String> matches)
path
does not map to a single ActionBean because it
potentially matches all the URL bindings in the matches
collection.message
- An informative message about what went wrongpath
- The offending pathmatches
- A collection of all the potentially matching URL bindingspublic UrlBindingConflictException(java.lang.String path, java.util.Collection<java.lang.String> matches)
path
does not map to a single ActionBean because it
potentially matches all the URL bindings in the matches
collection.path
- The offending pathmatches
- A collection of all the potentially matching URL bindingsprotected static java.lang.String getMessage(java.lang.Class<? extends ActionBean> targetClass, java.lang.String path, java.util.Collection<java.lang.String> matches)
public java.lang.String getPath()
public java.util.Collection<java.lang.String> getMatches()
public java.lang.Class<? extends ActionBean> getTargetClass()
ActionBean
class for which a URL was being generated when this exception was
thrown. If the exception occurred while dispatching a request, then this property will be
null since the path cannot be associated with an ActionBean class. However, if it is thrown
while generating a URL that is intended to point to an ActionBean, then this property will
indicate the class that was being targeted.? Copyright 2005-2006, Stripes Development Team.