本文整理匯總了Java中org.apache.struts.action.ActionMapping.getPath方法的典型用法代碼示例。如果您正苦於以下問題:Java ActionMapping.getPath方法的具體用法?Java ActionMapping.getPath怎麽用?Java ActionMapping.getPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.struts.action.ActionMapping
的用法示例。
在下文中一共展示了ActionMapping.getPath方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getValidationKey
import org.apache.struts.action.ActionMapping; //導入方法依賴的package包/類
/**
* Returns the Validation key
*
* @param mapping The mapping used to select this instance
* @param request The servlet request we are processing
* @return validation key to use
*/
public String getValidationKey(ActionMapping mapping,
HttpServletRequest request) {
String validationKey = null;
if (isPathValidation()) {
// Get the path replacing any slashes by underscore
validationKey = mapping.getPath();
// Remove any leading slash
if (validationKey.charAt(0) == '/') {
validationKey = validationKey.substring(1);
}
// Replace any slashes by underscore
if (validationKey.indexOf("/") > 0) {
validationKey = validationKey.replace('/', '_');
}
} else {
validationKey = mapping.getAttribute();
}
if (logger.isDebugEnabled()) {
logger.debug("Validating ActionForm '" + mapping.getName() +
"' using key '" + validationKey +
"' for mapping '" + mapping.getPath() + "'");
}
return validationKey;
}
示例2: getValidationKey
import org.apache.struts.action.ActionMapping; //導入方法依賴的package包/類
/**
* Returns the Validation key.
*
* @param mapping The mapping used to select this instance
* @param request The servlet request we are processing
* @return validation key - the action element's 'path' attribute in this case
*/
public String getValidationKey(ActionMapping mapping,
HttpServletRequest request) {
return mapping.getPath();
}