springmvcform-to-json

WebJar for springmvcform-to-json

License

License

ISC
Categories

Categories

JSON Data ORM
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

springmvcform-to-json
Last Version

Last Version

2.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

springmvcform-to-json
WebJar for springmvcform-to-json
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/donnchadh/springmvcform-to-json

Download springmvcform-to-json

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/springmvcform-to-json/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>springmvcform-to-json</artifactId>
    <version>2.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/springmvcform-to-json/
implementation 'org.webjars.npm:springmvcform-to-json:2.0.2'
// https://jarcasting.com/artifacts/org.webjars.npm/springmvcform-to-json/
implementation ("org.webjars.npm:springmvcform-to-json:2.0.2")
'org.webjars.npm:springmvcform-to-json:jar:2.0.2'
<dependency org="org.webjars.npm" name="springmvcform-to-json" rev="2.0.2">
  <artifact name="springmvcform-to-json" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='springmvcform-to-json', version='2.0.2')
)
libraryDependencies += "org.webjars.npm" % "springmvcform-to-json" % "2.0.2"
[org.webjars.npm/springmvcform-to-json "2.0.2"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

springmvcform-to-json

Build Status Code Coverage

Convert Spring-MVC form fields to JSON representation

Webjar dependency

Maven

<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>springmvcform-to-json</artifactId>
    <version>2.0.2</version>
</dependency>

Using this library with plain old JS

    var form = document.querySelector('#myForm');
    var formData = new FormData(form);
    var xhr = new XMLHttpRequest();
    xhr.open('POST', '/path/someController.do?action=anAction');
    xhr.setRequestHeader('Content-Type', 'application/json');
    xhr.onload = function() {
      if (xhr.status !== 200) {
        showErrors("<ul><li>Oops something went wrong on our side.</li></ul>");
      }
    };
    xhr.send(serializeFormData(formData));

Using this library with jQuery

    $.ajax({
        url: contextPath + '/path/someController.do?action=anAction',
        data: serializeFormDataArray($('#myForm').serializeArray()),
        method: 'POST',
        dataType: 'json'
    }).error(function() {
        _showErrors("<ul><li>Oops something went wrong on our side.</li></ul>");
    });

Building and Testing

Gitpod Ready-to-Code

npm run build
npm test

Versions

Version
2.0.2
2.0.1
2.0.0
1.0.2