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(Class<? extends ActionBean> targetClass,
String path,
Collection<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(String message,
Class<? extends ActionBean> targetClass,
String path,
Collection<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(String path,
Collection<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(String message,
String path,
Collection<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 |
|---|---|
Collection<String> |
getMatches()
Get all the URL bindings on existing ActionBeans that match the path
|
protected static String |
getMessage(Class<? extends ActionBean> targetClass,
String path,
Collection<String> matches)
Generate the message to pass to the superclass constructor
|
String |
getPath()
Get the path that failed to map to a single ActionBean
|
Class<? extends ActionBean> |
getTargetClass()
Get the
ActionBean class for which a URL was being generated when this exception was
thrown. |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic UrlBindingConflictException(String message, Class<? extends ActionBean> targetClass, String path, Collection<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(Class<? extends ActionBean> targetClass, String path, Collection<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(String message, String path, Collection<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(String path, Collection<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 String getMessage(Class<? extends ActionBean> targetClass, String path, Collection<String> matches)
public String getPath()
public Collection<String> getMatches()
public 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.