Method from org.apache.struts.config.ActionConfig Detail: |
public void addExceptionConfig(ExceptionConfig config) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
exceptions.put(config.getType(), config);
}
Add a new ExceptionConfig instance to the set associated
with this action. |
public void addForwardConfig(ForwardConfig config) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
forwards.put(config.getName(), config);
}
Add a new ForwardConfig instance to the set of global
forwards associated with this action. |
public ExceptionConfig findException(Class type) {
// Check through the entire superclass hierarchy as needed
ExceptionConfig config = null;
while (true) {
// Check for a locally defined handler
String name = type.getName();
config = findExceptionConfig(name);
if (config != null) {
return (config);
}
// Check for a globally defined handler
config = getModuleConfig().findExceptionConfig(name);
if (config != null) {
return (config);
}
// Loop again for our superclass (if any)
type = type.getSuperclass();
if (type == null) {
break;
}
}
return (null); // No handler has been configured
}
Find and return the ExceptionConfig instance defining
how Exceptions of the specified type should be handled.
This is performed by checking local and then global configurations for
the specified exception's class, and then looking up the superclass chain
(again checking local and then global configurations). If no handler
configuration can be found, return null .
Introduced in ActionMapping in Struts 1.1, but pushed
up to ActionConfig in Struts 1.2.0.
|
public ExceptionConfig findExceptionConfig(String type) {
return ((ExceptionConfig) exceptions.get(type));
}
Return the exception configuration for the specified type, if any;
otherwise return null . |
public ExceptionConfig[] findExceptionConfigs() {
ExceptionConfig results[] = new ExceptionConfig[exceptions.size()];
return ((ExceptionConfig[]) exceptions.values().toArray(results));
}
Return the exception configurations for this action. If there
are none, a zero-length array is returned. |
public ForwardConfig findForwardConfig(String name) {
return ((ForwardConfig) forwards.get(name));
}
Return the forward configuration for the specified key, if any;
otherwise return null . |
public ForwardConfig[] findForwardConfigs() {
ForwardConfig results[] = new ForwardConfig[forwards.size()];
return ((ForwardConfig[]) forwards.values().toArray(results));
}
Return all forward configurations for this module. If there
are none, a zero-length array is returned. |
public void freeze() {
configured = true;
ExceptionConfig[] econfigs = findExceptionConfigs();
for (int i = 0; i < econfigs.length; i++) {
econfigs[i].freeze();
}
ForwardConfig[] fconfigs = findForwardConfigs();
for (int i = 0; i < fconfigs.length; i++) {
fconfigs[i].freeze();
}
}
Freeze the configuration of this action. |
public String getAttribute() {
if (this.attribute == null) {
return (this.name);
} else {
return (this.attribute);
}
}
Returns the request-scope or session-scope attribute name under which our
form bean is accessed, if it is different from the form bean's
specified name . |
public boolean getCancellable() {
return (this.cancellable);
}
|
public String getForward() {
return (this.forward);
}
Returns context-relative path of the web application resource that will process
this request. |
public String getInclude() {
return (this.include);
}
Context-relative path of the web application resource that will process
this request. |
public String getInput() {
return (this.input);
}
Get the context-relative path of the input form to which control should be
returned if a validation error is encountered. |
public ModuleConfig getModuleConfig() {
return (this.moduleConfig);
}
The module configuration with which we are associated. |
public String getMultipartClass() {
return (this.multipartClass);
}
Return the fully qualified Java class name of the
MultipartRequestHandler implementation class used to
process multi-part request data for this Action. |
public String getName() {
return (this.name);
}
Return name of the form bean, if any, associated with this Action. |
public String getParameter() {
return (this.parameter);
}
Return general purpose configuration parameter that can be used to pass
extra information to the Action instance selected by this Action.
Struts does not itself use this value in any way. |
public String getPath() {
return (this.path);
}
Return context-relative path of the submitted request, starting with a
slash ("/") character, and omitting any filename extension if
extension mapping is being used. |
public String getPrefix() {
return (this.prefix);
}
Retruns prefix used to match request parameter names to form bean property
names, if any. |
public String[] getRoleNames() {
return (this.roleNames);
}
Get array of security role names used to authorize access to this
Action. |
public String getRoles() {
return (this.roles);
}
|
public String getScope() {
return (this.scope);
}
Get the scope ("request" or "session") within which
our form bean is accessed, if any. |
public String getSuffix() {
return (this.suffix);
}
Return suffix used to match request parameter names to form bean property
names, if any. |
public String getType() {
return (this.type);
}
|
public boolean getUnknown() {
return (this.unknown);
}
Determine whether Action is configured as the default one for this
module. |
public boolean getValidate() {
return (this.validate);
}
|
public void removeExceptionConfig(ExceptionConfig config) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
exceptions.remove(config.getType());
}
Remove the specified exception configuration instance. |
public void removeForwardConfig(ForwardConfig config) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
forwards.remove(config.getName());
}
Remove the specified forward configuration instance. |
public void setAttribute(String attribute) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.attribute = attribute;
}
Set the request-scope or session-scope attribute name under which our
form bean is accessed, if it is different from the form bean's
specified name . |
public void setCancellable(boolean cancellable) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.cancellable = cancellable;
}
|
public void setForward(String forward) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.forward = forward;
}
Set the context-relative path of the web application resource that will process
this request.
Exactly one of forward , include , or
type must be specified. |
public void setInclude(String include) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.include = include;
}
Set context-relative path of the web application resource that will process
this request.
Exactly one of forward , include , or
type must be specified. |
public void setInput(String input) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.input = input;
}
Set the context-relative path of the input form to which control should be
returned if a validation error is encountered. Required if "name"
is specified and the input bean returns validation errors. |
public void setModuleConfig(ModuleConfig moduleConfig) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.moduleConfig = moduleConfig;
}
The module configuration with which we are associated. |
public void setMultipartClass(String multipartClass) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.multipartClass = multipartClass;
}
Set the fully qualified Java class name of the
MultipartRequestHandler implementation class used to
process multi-part request data for this Action. |
public void setName(String name) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.name = name;
}
|
public void setParameter(String parameter) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.parameter = parameter;
}
General purpose configuration parameter that can be used to pass
extra information to the Action instance selected by this Action.
Struts does not itself use this value in any way. |
public void setPath(String path) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.path = path;
}
Set context-relative path of the submitted request, starting with a
slash ("/") character, and omitting any filename extension if
extension mapping is being used. |
public void setPrefix(String prefix) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.prefix = prefix;
}
|
public void setRoles(String roles) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.roles = roles;
if (roles == null) {
roleNames = new String[0];
return;
}
ArrayList list = new ArrayList();
while (true) {
int comma = roles.indexOf(',');
if (comma < 0)
break;
list.add(roles.substring(0, comma).trim());
roles = roles.substring(comma + 1);
}
roles = roles.trim();
if (roles.length() > 0)
list.add(roles);
roleNames = (String[]) list.toArray(new String[list.size()]);
}
|
public void setScope(String scope) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.scope = scope;
}
|
public void setSuffix(String suffix) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.suffix = suffix;
}
|
public void setType(String type) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.type = type;
}
|
public void setUnknown(boolean unknown) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.unknown = unknown;
}
|
public void setValidate(boolean validate) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.validate = validate;
}
|
public String toString() {
StringBuffer sb = new StringBuffer("ActionConfig[");
sb.append("path=");
sb.append(path);
if (attribute != null) {
sb.append(",attribute=");
sb.append(attribute);
}
if (forward != null) {
sb.append(",forward=");
sb.append(forward);
}
if (include != null) {
sb.append(",include=");
sb.append(include);
}
if (input != null) {
sb.append(",input=");
sb.append(input);
}
if (multipartClass != null) {
sb.append(",multipartClass=");
sb.append(multipartClass);
}
if (name != null) {
sb.append(",name=");
sb.append(name);
}
if (parameter != null) {
sb.append(",parameter=");
sb.append(parameter);
}
if (prefix != null) {
sb.append(",prefix=");
sb.append(prefix);
}
if (roles != null) {
sb.append(",roles=");
sb.append(roles);
}
if (scope != null) {
sb.append(",scope=");
sb.append(scope);
}
if (suffix != null) {
sb.append(",suffix=");
sb.append(suffix);
}
if (type != null) {
sb.append(",type=");
sb.append(type);
}
sb.append(",validate=");
sb.append(validate);
sb.append(",cancellable=");
sb.append(cancellable);
return (sb.toString());
}
Return a String representation of this object. |