Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions grace-plugin-databinding/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ dependencies {
api project(":grace-api")
compileOnly project(":grace-plugin-api")
api project(":grace-web")
api project(":grace-web-databinding")

compileOnly libs.jakarta.servlet
api libs.spring.boot.autoconfigure
Expand Down
2 changes: 2 additions & 0 deletions grace-web-databinding/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## grace-web-databinding

12 changes: 12 additions & 0 deletions grace-web-databinding/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
dependencies {
api project(":grace-databinding")
api project(":grace-util")
api project(":grace-web")

compileOnly libs.grace.datastore.core
compileOnly libs.jakarta.annotation.api
compileOnlyApi libs.jakarta.servlet

testImplementation libs.jakarta.servlet
testImplementation libs.spring.test
}
1 change: 0 additions & 1 deletion grace-web/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
dependencies {
api project(":grace-api")
api project(":grace-core")
api project(":grace-databinding")
api project(":grace-encoder")
compileOnly project(":grace-plugin-api")
api project(":grace-util")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;

import grails.databinding.DataBinder;
import grails.io.IOUtils;
import grails.util.TypeConvertingMap;
import grails.web.mime.MimeType;
Expand Down Expand Up @@ -72,6 +71,8 @@ public class GrailsParameterMap extends TypeConvertingMap implements Cloneable {

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

public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss.S";

/**
* Does not populate the GrailsParameterMap from the request but instead uses the supplied values.
*
Expand Down Expand Up @@ -302,7 +303,7 @@ private Date lazyEvaluateDateParam(Object key) {
}
}

DateFormat dateFormat = new SimpleDateFormat(DataBinder.DEFAULT_DATE_FORMAT,
DateFormat dateFormat = new SimpleDateFormat(DEFAULT_DATE_FORMAT,
LocaleContextHolder.getLocale());
StructuredDateEditor editor = new StructuredDateEditor(dateFormat, true);
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import org.springframework.beans.propertyeditors.CustomNumberEditor
import org.springframework.web.context.WebApplicationContext
import org.springframework.web.context.support.WebApplicationContextUtils

import grails.databinding.DataBinder
import grails.util.Environment

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

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

/**
* Registers all known
Expand All @@ -57,7 +57,7 @@ class PropertyEditorRegistryUtils {
NumberFormat floatFormat = NumberFormat.getInstance(locale)
NumberFormat integerFormat = NumberFormat.getIntegerInstance(locale)

SimpleDateFormat dateFormat = new SimpleDateFormat(DataBinder.DEFAULT_DATE_FORMAT, locale)
SimpleDateFormat dateFormat = new SimpleDateFormat(DEFAULT_DATE_FORMAT, locale)

registry.registerCustomEditor(Date, new CustomDateEditor(dateFormat, true))
registry.registerCustomEditor(BigDecimal, new CustomNumberEditor(BigDecimal, floatFormat, true))
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ include (
'grace-views-json',
'grace-views-markup',
'grace-web',
'grace-web-databinding',
'grace-web-gsp',
'grace-web-mvc',
'grace-web-rest',
Expand Down