本文整理匯總了Java中org.springframework.web.servlet.HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE屬性的典型用法代碼示例。如果您正苦於以下問題:Java HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE屬性的具體用法?Java HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE怎麽用?Java HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.springframework.web.servlet.HandlerMapping
的用法示例。
在下文中一共展示了HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addBindValues
/**
* Merge URI variables into the property values to use for data binding.
*/
@Override
@SuppressWarnings("unchecked")
protected void addBindValues(MutablePropertyValues mpvs, ServletRequest request) {
String attr = HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE;
Map<String, String> uriVars = (Map<String, String>) request.getAttribute(attr);
if (uriVars != null) {
for (Entry<String, String> entry : uriVars.entrySet()) {
if (mpvs.contains(entry.getKey())) {
logger.warn("Skipping URI variable '" + entry.getKey()
+ "' since the request contains a bind value with the same name.");
}
else {
mpvs.addPropertyValue(entry.getKey(), entry.getValue());
}
}
}
}
示例2: getCurrentRequestUriVariables
@SuppressWarnings("unchecked")
private Map<String, String> getCurrentRequestUriVariables(HttpServletRequest request) {
String name = HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE;
Map<String, String> uriVars = (Map<String, String>) request.getAttribute(name);
return (uriVars != null) ? uriVars : Collections.<String, String> emptyMap();
}
示例3: getUriTemplateVariables
@SuppressWarnings("unchecked")
private Map<String, String> getUriTemplateVariables(HttpServletRequest request) {
String attrName = HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE;
return (Map<String, String>) request.getAttribute(attrName);
}