mirror of
https://github.com/apache/struts.git
synced 2026-08-31 19:35:40 +00:00
WW-4453 Reports missing value
This commit is contained in:
@@ -69,6 +69,7 @@ public class Component {
|
||||
*/
|
||||
protected static ConcurrentMap<Class<?>, Collection<String>> standardAttributesMap = new ConcurrentHashMap<Class<?>, Collection<String>>();
|
||||
|
||||
protected boolean devMode = false;
|
||||
protected ValueStack stack;
|
||||
protected Map parameters;
|
||||
protected ActionMapper actionMapper;
|
||||
@@ -97,7 +98,12 @@ public class Component {
|
||||
|
||||
return name.substring(dot + 1).toLowerCase();
|
||||
}
|
||||
|
||||
|
||||
@Inject(value = StrutsConstants.STRUTS_DEVMODE, required = false)
|
||||
public void setDevMode(String devMode) {
|
||||
this.devMode = Boolean.parseBoolean(devMode);
|
||||
}
|
||||
|
||||
@Inject
|
||||
public void setActionMapper(ActionMapper mapper) {
|
||||
this.actionMapper = mapper;
|
||||
|
||||
@@ -285,6 +285,14 @@ public class Date extends ContextBean {
|
||||
date = (java.util.Date) dateObject;
|
||||
} else if(dateObject instanceof Calendar){
|
||||
date = ((Calendar) dateObject).getTime();
|
||||
} else {
|
||||
if (devMode) {
|
||||
LOG.error("Expression [#0] passed to <s:date/> tag which was evaluated to [#1](#2) isn't instance of java.util.Date nor java.util.Calendar!",
|
||||
name, dateObject, (dateObject != null ? dateObject.getClass() : "null"));
|
||||
} else {
|
||||
LOG.debug("Expression [#0] passed to <s:date/> tag which was evaluated to [#1](#2) isn't instance of java.util.Date nor java.util.Calendar!",
|
||||
name, dateObject, (dateObject != null ? dateObject.getClass() : "null"));
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOG.error("Could not convert object with key '#0' to a java.util.Date instance", name);
|
||||
|
||||
Reference in New Issue
Block a user