📄 connectorform.java
字号:
/**
* Set the object name of the Service this connector belongs to.
*/
public void setKeyStoreFileName(String keyStoreFileName) {
this.keyStoreFileName = keyStoreFileName;
}
/**
* Return the object name of the service this connector belongs to.
*/
public String getKeyStorePassword() {
return this.keyStorePassword;
}
/**
* Set the object name of the Service this connector belongs to.
*/
public void setKeyStorePassword(String keyStorePassword) {
this.keyStorePassword = keyStorePassword;
}
/**
* Return the keystore type.
*/
public String getKeyStoreType() {
return this.keyStoreType;
}
/**
* Set the keystore type.
*/
public void setKeyStoreType(String keyStoreType) {
this.keyStoreType = keyStoreType;
}
/**
* Return the sslProtocol
*/
public String getSslProtocol() {
return this.sslProtocol;
}
/**
* Set the sslProtocol.
*/
public void setSslProtocol(String sslProtocol) {
this.sslProtocol = sslProtocol;
}
/**
* Return the debugVals.
*/
public List getDebugLvlVals() {
return this.debugLvlVals;
}
/**
* Set the debugVals.
*/
public void setDebugLvlVals(List debugLvlVals) {
this.debugLvlVals = debugLvlVals;
}
/**
* Return the Debug Level Text.
*/
public String getDebugLvl() {
return this.debugLvl;
}
/**
* Set the Debug Level Text.
*/
public void setDebugLvl(String debugLvl) {
this.debugLvl = debugLvl;
}
/**
* Return the Enable lookup Text.
*/
public String getEnableLookups() {
return this.enableLookups;
}
/**
* Set the Enable Lookup Text.
*/
public void setEnableLookups(String enableLookups) {
this.enableLookups = enableLookups;
}
/**
* Return the disableUploadTimeout.
*/
public String getDisableUploadTimeout() {
return this.disableUploadTimeout;
}
/**
* Set the disableUploadTimeout.
*/
public void setDisableUploadTimeout(String disableUploadTimeout) {
this.disableUploadTimeout = disableUploadTimeout;
}
/**
* Return the compression Text.
*/
public String getCompression() {
return this.compression;
}
/**
* Set the Compression Text.
*/
public void setCompression(String compression) {
this.compression = compression;
}
/**
* Return the booleanVals.
*/
public List getBooleanVals() {
return this.booleanVals;
}
/**
* Set the debugVals.
*/
public void setBooleanVals(List booleanVals) {
this.booleanVals = booleanVals;
}
/**
* Return the clientAuth values.
*/
public List getClientAuthVals() {
return clientAuthVals;
}
/**
* Set the clientAuth vaues.
*/
public void setClientAuthVals(List clientAuthVals) {
this.clientAuthVals = clientAuthVals;
}
/**
* Return the min Processors Text.
*/
public String getMinProcessorsText() {
return this.minProcessorsText;
}
/**
* Set the minProcessors Text.
*/
public void setMinProcessorsText(String minProcessorsText) {
this.minProcessorsText = minProcessorsText;
}
/**
* Return the max processors Text.
*/
public String getMaxProcessorsText() {
return this.maxProcessorsText;
}
/**
* Set the Max Processors Text.
*/
public void setMaxProcessorsText(String maxProcessorsText) {
this.maxProcessorsText = maxProcessorsText;
}
/**
* Return the maxKeepAliveText.
*/
public String getMaxKeepAliveText() {
return this.maxKeepAliveText;
}
/**
* Set the maxKeepAliveText.
*/
public void setMaxKeepAliveText(String maxKeepAliveText) {
this.maxKeepAliveText = maxKeepAliveText;
}
/**
* Return the maxSpare.
*/
public String getMaxSpare() {
return this.maxSpare;
}
/**
* Set the maxSpare.
*/
public void setMaxSpare(String maxSpare) {
this.maxSpare = maxSpare;
}
/**
* Return the maxThreads.
*/
public String getMaxThreads() {
return this.maxThreads;
}
/**
* Set the maxThreads.
*/
public void setMaxThreads(String maxThreads) {
this.maxThreads = maxThreads;
}
/**
* Return the minSpare.
*/
public String getMinSpare() {
return this.minSpare;
}
/**
* Set the minSpare.
*/
public void setMinSpare(String minSpare) {
this.minSpare = minSpare;
}
/**
* Return the URIEncoding text.
*/
public String getURIEncodingText() {
return this.uriEncodingText;
}
/**
* Set the URIEncoding Text.
*/
public void setURIEncodingText(String uriEncodingText) {
this.uriEncodingText = uriEncodingText;
}
/**
* Return the useBodyEncodingForURI Text.
*/
public String getUseBodyEncodingForURIText() {
return this.useBodyEncodingForURI;
}
/**
* Set the useBodyEncodingForURI Text.
*/
public void setUseBodyEncodingForURIText(String useBodyEncodingForURI) {
this.useBodyEncodingForURI = useBodyEncodingForURI;
}
/**
* Return the allowTrace Text.
*/
public String getAllowTraceText() {
return this.allowTrace;
}
/**
* Set the allowTrace Text.
*/
public void setAllowTraceText(String allowTrace) {
this.allowTrace = allowTrace;
}
/**
* Return the port text.
*/
public String getPortText() {
return this.portText;
}
/**
* Set the port Text.
*/
public void setPortText(String portText) {
this.portText = portText;
}
/**
* Return the port.
*/
public String getRedirectPortText() {
return this.redirectPortText;
}
/**
* Set the Redirect Port Text.
*/
public void setRedirectPortText(String redirectPortText) {
this.redirectPortText = redirectPortText;
}
/**
* Return the Service Name.
*/
public String getConnectorName() {
return this.connectorName;
}
/**
* Set the Service Name.
*/
public void setConnectorName(String connectorName) {
this.connectorName = connectorName;
}
/**
* Return the connectorTypeVals.
*/
public List getConnectorTypeVals() {
return this.connectorTypeVals;
}
/**
* Set the connectorTypeVals.
*/
public void setConnectorTypeVals(List connectorTypeVals) {
this.connectorTypeVals = connectorTypeVals;
}
/**
* Return the secure Text.
*/
public String getSecure() {
return this.secure;
}
/**
* Set the secure Text.
*/
public void setSecure(String secure) {
this.secure = secure;
}
/**
* Return the tcpNoDelay Text.
*/
public String getTcpNoDelay() {
return this.tcpNoDelay;
}
/**
* Set the tcpNoDelay Text.
*/
public void setTcpNoDelay(String tcpNoDelay) {
this.tcpNoDelay = tcpNoDelay;
}
/**
* Return the xpoweredBy Text.
*/
public String getXpoweredBy() {
return this.xpoweredBy;
}
/**
* Set the xpoweredBy Text.
*/
public void setXpoweredBy(String xpoweredBy) {
this.xpoweredBy = xpoweredBy;
}
// --------------------------------------------------------- Public Methods
/**
* Reset all properties to their default values.
*
* @param mapping The mapping used to select this instance
* @param request The servlet request we are processing
*/
public void reset(ActionMapping mapping, HttpServletRequest request) {
this.objectName = null;
this.connectorType = null;
this.portText = null;
this.acceptCountText = null;
this.connLingerText = null;
this.connTimeOutText = null;
this.connUploadTimeOutText = null;
this.bufferSizeText = null;
this.address = null;
this.enableLookups = "false";
this.compression = "off";
this.minProcessorsText = null;
this.maxProcessorsText = null;
this.maxKeepAliveText = null;
this.maxSpare = null;
this.maxThreads = null;
this.minSpare = null;
this.uriEncodingText = null;
this.useBodyEncodingForURI = "false";
this.allowTrace = "false";
this.portText = null;
this.redirectPortText = null;
this.proxyName = null;
this.proxyPortText = null;
this.keyStoreFileName = null;
this.keyStorePassword = null;
this.clientAuthentication = "false";
this.secure = "false";
this.tcpNoDelay = "false";
this.xpoweredBy = "false";
}
/**
* Validate the properties that have been set from this HTTP request,
* and return an <code>ActionErrors</code> object that encapsulates any
* validation errors that have been found. If no errors are found, return
* <code>null</code> or an <code>ActionErrors</code> object with no
* recorded error messages.
*
* @param mapping The mapping used to select this instance
* @param request The servlet request we are processing
*/
private ActionErrors errors;
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
errors = new ActionErrors();
String submit = request.getParameter("submit");
// front end validation when save is clicked.
//if (submit != null) {
/* The IP address can also be null -- which means open the
server socket on *all* IP addresses for this host */
if ((address.length() > 0) && !address.equalsIgnoreCase(" ")) {
try {
InetAddress.getByName(address);
} catch (Exception e) {
errors.add("address", new ActionError("error.address.invalid"));
}
} else {
address = " ";
}
/* ports */
numberCheck("portNumber", portText, true, 1, 65535);
numberCheck("redirectPortText", redirectPortText, true, -1, 65535);
/* processors*/
//numberCheck("minProcessorsText", minProcessorsText, true, 1, 512);
//try {
// if min is a valid integer, then check that max >= min
//int min = Integer.parseInt(minProcessorsText);
//numberCheck("maxProcessorsText", maxProcessorsText, true, min, 512);
//} catch (Exception e) {
// check for the complete range
//numberCheck("maxProcessorsText", maxProcessorsText, true, 1, 512);
//}
// proxy
if ((proxyName!= null) && (proxyName.length() > 0)) {
try {
InetAddress.getByName(proxyName);
} catch (Exception e) {
errors.add("proxyName", new ActionError("error.proxyName.invalid"));
}
}
// supported only by Coyote HTTP and HTTPS connectors
if (!("AJP".equalsIgnoreCase(connectorType))) {
numberCheck("acceptCountText", acceptCountText, true, 0, 128);
//numberCheck("connTimeOutText", connTimeOutText, true, -1, 60000);
numberCheck("bufferSizeText", bufferSizeText, true, 1, 8192);
numberCheck("proxyPortText", proxyPortText, true, 0, 65535);
}
//}
return errors;
}
/*
* Helper method to check that it is a required number and
* is a valid integer within the given range. (min, max).
*
* @param field The field name in the form for which this error occured.
* @param numText The string representation of the number.
* @param rangeCheck Boolean value set to true of reange check should be performed.
*
* @param min The lower limit of the range
* @param max The upper limit of the range
*
*/
public void numberCheck(String field, String numText, boolean rangeCheck,
int min, int max) {
/* Check for 'is required' */
if ((numText == null) || (numText.length() < 1)) {
errors.add(field, new ActionError("error."+field+".required"));
} else {
/*check for 'must be a number' in the 'valid range'*/
try {
int num = Integer.parseInt(numText);
// perform range check only if required
if (rangeCheck) {
if ((num < min) || (num > max ))
errors.add( field,
new ActionError("error."+ field +".range"));
}
} catch (NumberFormatException e) {
errors.add(field,
new ActionError("error."+ field + ".format"));
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -