diff --git a/core/src/main/java/org/apache/struts2/components/Date.java b/core/src/main/java/org/apache/struts2/components/Date.java index 6500ef5f6..3c89ce43f 100644 --- a/core/src/main/java/org/apache/struts2/components/Date.java +++ b/core/src/main/java/org/apache/struts2/components/Date.java @@ -23,6 +23,7 @@ package org.apache.struts2.components; import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.TextProvider; +import com.opensymphony.xwork2.util.LocalizedTextUtil; import com.opensymphony.xwork2.util.ValueStack; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -291,8 +292,17 @@ public class Date extends ContextBean { date = ((Calendar) dateObject).getTime(); } else { if (devMode) { - LOG.error("Expression [{}] passed to tag which was evaluated to [{}]({}) isn't instance of java.util.Date nor java.util.Calendar!", - name, dateObject, (dateObject != null ? dateObject.getClass() : "null")); + String developerNotification = LocalizedTextUtil.findText( + Date.class, + "devmode.notification", + ActionContext.getContext().getLocale(), + "Developer Notification:\n{0}", + new Object[]{ + "Expression [" + name + "] passed to tag which was evaluated to [" + dateObject + "](" + + (dateObject != null ? dateObject.getClass() : "null") + ") isn't instance of java.util.Date nor java.util.Calendar!" + } + ); + LOG.warn(developerNotification); } else { LOG.debug("Expression [{}] passed to tag which was evaluated to [{}]({}) isn't instance of java.util.Date nor java.util.Calendar!", name, dateObject, (dateObject != null ? dateObject.getClass() : "null"));