📄 actionconfig.java
字号:
/**
* <p> Get the context-relative path of the input form to which control
* should be returned if a validation error is encountered.
*
* @return context-relative path of the input form to which control should
* be returned if a validation error is encountered.
*/
public String getInput() {
return (this.input);
}
/**
* <p> 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.
*
* @param input context-relative path of the input form to which control
* should be returned if a validation error is encountered.
*/
public void setInput(String input) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.input = input;
}
/**
* <p> Return the fully qualified Java class name of the
* <code>MultipartRequestHandler</code> implementation class used to
* process multi-part request data for this Action.
*/
public String getMultipartClass() {
return (this.multipartClass);
}
/**
* <p> Set the fully qualified Java class name of the
* <code>MultipartRequestHandler</code> implementation class used to
* process multi-part request data for this Action.
*
* @param multipartClass fully qualified class name of the
* <code>MultipartRequestHandler</code>
* implementation class.
*/
public void setMultipartClass(String multipartClass) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.multipartClass = multipartClass;
}
/**
* <p> Return name of the form bean, if any, associated with this Action.
*/
public String getName() {
return (this.name);
}
/**
* @param name name of the form bean associated with this Action.
*/
public void setName(String name) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.name = name;
}
/**
* <p> 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 getParameter() {
return (this.parameter);
}
/**
* <p> 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.
*
* @param parameter General purpose configuration parameter.
*/
public void setParameter(String parameter) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.parameter = parameter;
}
/**
* <p> 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 getPath() {
return (this.path);
}
/**
* <p> Set context-relative path of the submitted request, starting with a
* slash ("/") character, and omitting any filename extension if extension
* mapping is being used.
*
* @param path context-relative path of the submitted request.
*/
public void setPath(String path) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.path = path;
}
/**
* <p> Retruns prefix used to match request parameter names to form bean
* property names, if any.
*/
public String getPrefix() {
return (this.prefix);
}
/**
* @param prefix Prefix used to match request parameter names to form bean
* property names, if any.
*/
public void setPrefix(String prefix) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.prefix = prefix;
}
public String getRoles() {
return (this.roles);
}
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()]);
}
/**
* <p> Get array of security role names used to authorize access to this
* Action.
*/
public String[] getRoleNames() {
return (this.roleNames);
}
/**
* <p> Get the scope ("request" or "session") within which our form bean
* is accessed, if any.
*/
public String getScope() {
return (this.scope);
}
/**
* @param scope scope ("request" or "session") within which our form bean
* is accessed, if any.
*/
public void setScope(String scope) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.scope = scope;
}
/**
* <p>Reads when a corresponding action form should be reset
* ("request", "session" or "request,session").</p>
*
* @since Struts 1.4
*/
public String getReset() {
return (this.reset);
}
/**
* @param reset identifies, when a corresponding action form should be
* reset ("request", "session" or "request,session").
*
* @since Struts 1.4
*/
public void setReset(String reset) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.reset = reset;
}
/**
* <p>Reads when a corresponding action form should be automatically
* populated ("request", "session" or "request,session").</p>
*
* @since Struts 1.4
*/
public String getPopulate() {
return (this.populate);
}
/**
* @param populate identifies, when a corresponding action form should be
* automatically populated ("request", "session" or "request,session").
*
* @since Struts 1.4
*/
public void setPopulate(String populate) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.populate= populate;
}
/**
* <p> Return suffix used to match request parameter names to form bean
* property names, if any. </p>
*/
public String getSuffix() {
return (this.suffix);
}
/**
* @param suffix Suffix used to match request parameter names to form bean
* property names, if any.
*/
public void setSuffix(String suffix) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.suffix = suffix;
}
public String getType() {
return (this.type);
}
public void setType(String type) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.type = type;
}
/**
* <p> Determine whether Action is configured as the default one for this
* module. </p>
*/
public boolean getUnknown() {
return (this.unknown);
}
/**
* @param unknown Indicates Action is configured as the default one for
* this module, when true.
*/
public void setUnknown(boolean unknown) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.unknown = unknown;
}
public boolean getValidate() {
return (this.validate);
}
public void setValidate(boolean validate) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.validate = validate;
this.validateSet = true;
}
/**
* <p> Get the name of a <code>commons-chain</code> command which should
* be executed as part of the processing of this action. </p>
*
* @return name of a <code>commons-chain</code> command which should be
* executed as part of the processing of this action.
* @since Struts 1.3.0
*/
public String getCommand() {
return (this.command);
}
/**
* <p> Get the name of a <code>commons-chain</code> catalog in which a
* specified command should be sought. This is likely to be infrequently
* used after a future release of <code>commons-chain</code> supports a
* one-string expression of a catalog/chain combination. </p>
*
* @return name of a <code>commons-chain</code> catalog in which a
* specified command should be sought.
* @since Struts 1.3.0
*/
public String getCatalog() {
return (this.catalog);
}
/**
* <p> Set the name of a <code>commons-chain</code> command which should
* be executed as part of the processing of this action. </p>
*
* @param command name of a <code>commons-chain</code> command which
* should be executed as part of the processing of this
* action.
* @since Struts 1.3.0
*/
public void setCommand(String command) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.command = command;
}
/**
* <p> Set the name of a <code>commons-chain</code> catalog in which a
* specified command should be sought. This is likely to be infrequently
* used after a future release of <code>commons-chain</code> supports a
* one-string expression of a catalog/chain combination. </p>
*
* @param catalog name of a <code>commons-chain</code> catalog in which a
* specified command should be sought.
* @since Struts 1.3.0
*/
public void setCatalog(String catalog) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.catalog = catalog;
}
// ------------------------------------------------------ Protected Methods
/**
* <p>Traces the hierarchy of this object to check if any of the ancestors
* is extending this instance.</p>
*
* @param moduleConfig The configuration for the module being configured.
* @return true if circular inheritance was detected.
*/
protected boolean checkCircularInheritance(ModuleConfig moduleConfig) {
String ancestorPath = getExtends();
while (ancestorPath != null) {
// check if we have the same path as an ancestor
if (getPath().equals(ancestorPath)) {
return true;
}
// get our ancestor's ancestor
ActionConfig ancestor = moduleConfig.findActionConfig(ancestorPath);
if (ancestor != null) {
ancestorPath = ancestor.getExtends();
} else {
ancestorPath = null;
}
}
return false;
}
/**
* <p>Compare the exception handlers of this action with that of the given
* and copy those that are not present.</p>
*
* @param baseConfig The action config to copy handlers from.
* @see #inheritFrom(ActionConfig)
*/
protected void inheritExceptionHandlers(ActionConfig baseConfig)
throws ClassNotFoundException, IllegalAccessException,
InstantiationException, InvocationTargetException {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
// Inherit exception handler configs
ExceptionConfig[] baseHandlers = baseConfig.findExceptionConfigs();
for (int i = 0; i < baseHandlers.length; i++) {
ExceptionConfig baseHandler = baseHandlers[i];
// Do we have this handler?
ExceptionConfig copy =
this.findExceptionConfig(baseHandler.getType());
if (copy == null) {
// We don't have this, so let's copy it
copy =
(ExceptionConfig) RequestUtils.applicationInstance(baseHandler.getClass()
.getName());
BeanUtils.copyProperties(copy, baseHandler);
this.addExceptionConfig(copy);
copy.setProperties(baseHandler.copyProperties());
} else {
// process any extension that this config might have
copy.processExtends(getModuleConfig(), this);
}
}
}
/**
* <p>Compare the forwards of this action with that of the given and copy
* those that are not present.</p>
*
* @param baseConfig The action config to copy forwards from.
* @see #inheritFrom(ActionConfig)
*/
protected void inheritForwards(ActionConfig baseConfig)
throws ClassNotFoundException, IllegalAccessException,
InstantiationException, InvocationTargetException {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -