Skip to content

Commit c576e84

Browse files
committed
Decouple grace-web from grace-databinding
GrailsParameterMap and PropertyEditorRegistryUtils use DataBinder.DEFAULT_DATE_FORMAT
1 parent 18de6f8 commit c576e84

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

grace-web/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
dependencies {
22
api project(":grace-api")
33
api project(":grace-core")
4-
api project(":grace-databinding")
54
api project(":grace-encoder")
65
compileOnly project(":grace-plugin-api")
76
api project(":grace-util")

grace-web/src/main/groovy/grails/web/servlet/mvc/GrailsParameterMap.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import org.springframework.web.multipart.MultipartFile;
3838
import org.springframework.web.multipart.MultipartHttpServletRequest;
3939

40-
import grails.databinding.DataBinder;
4140
import grails.io.IOUtils;
4241
import grails.util.TypeConvertingMap;
4342
import grails.web.mime.MimeType;
@@ -72,6 +71,8 @@ public class GrailsParameterMap extends TypeConvertingMap implements Cloneable {
7271

7372
public static final Object[] EMPTY_ARGS = new Object[0];
7473

74+
public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss.S";
75+
7576
/**
7677
* Does not populate the GrailsParameterMap from the request but instead uses the supplied values.
7778
*
@@ -302,7 +303,7 @@ private Date lazyEvaluateDateParam(Object key) {
302303
}
303304
}
304305

305-
DateFormat dateFormat = new SimpleDateFormat(DataBinder.DEFAULT_DATE_FORMAT,
306+
DateFormat dateFormat = new SimpleDateFormat(DEFAULT_DATE_FORMAT,
306307
LocaleContextHolder.getLocale());
307308
StructuredDateEditor editor = new StructuredDateEditor(dateFormat, true);
308309
try {

grace-web/src/main/groovy/org/grails/web/beans/PropertyEditorRegistryUtils.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import org.springframework.beans.propertyeditors.CustomNumberEditor
2828
import org.springframework.web.context.WebApplicationContext
2929
import org.springframework.web.context.support.WebApplicationContextUtils
3030

31-
import grails.databinding.DataBinder
3231
import grails.util.Environment
3332

3433
import org.grails.web.binding.CompositeEditor
@@ -44,6 +43,7 @@ class PropertyEditorRegistryUtils {
4443

4544
private static final String PROPERTY_EDITOR_REGISTRARS = 'org.codehaus.groovy.grails.PROPERTY_EDITOR_REGISTRARS'
4645
private static final String JSON_DATE_FORMAT = "yyyy-MM-dd'T'hh:mm:ss'Z'"
46+
private static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss.S";
4747

4848
/**
4949
* Registers all known
@@ -57,7 +57,7 @@ class PropertyEditorRegistryUtils {
5757
NumberFormat floatFormat = NumberFormat.getInstance(locale)
5858
NumberFormat integerFormat = NumberFormat.getIntegerInstance(locale)
5959

60-
SimpleDateFormat dateFormat = new SimpleDateFormat(DataBinder.DEFAULT_DATE_FORMAT, locale)
60+
SimpleDateFormat dateFormat = new SimpleDateFormat(DEFAULT_DATE_FORMAT, locale)
6161

6262
registry.registerCustomEditor(Date, new CustomDateEditor(dateFormat, true))
6363
registry.registerCustomEditor(BigDecimal, new CustomNumberEditor(BigDecimal, floatFormat, true))

0 commit comments

Comments
 (0)