spring-mvc-ajax | Sample Spring MVC Application demonstrating JSON | Model View Controller library
kandi X-RAY | spring-mvc-ajax Summary
kandi X-RAY | spring-mvc-ajax Summary
Sample Spring MVC Application demonstrating JSON AJAX requests with Java Spring MVC back-end.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Get a random person
- Generates a random age
- Returns a random name
- Set the age of the entry
- Set the name
- Saves a person
- Returns a string representation of this person
- Retrieves a Person object based on its ID
- This bean will be overwritten by default
- Returns the person with the given id
- Gets a single person
- Returns a random person
- Define a new controller for page use
spring-mvc-ajax Key Features
spring-mvc-ajax Examples and Code Snippets
Community Discussions
Trending Discussions on spring-mvc-ajax
QUESTION
Hey guys I need some explanation what's wrong with my Code! But first of all I have to say that I'm neither an expert at spring nor at uploading files with Java...
I'm using Spring Boot as backend server and I have a JavaScript frontend.
For sending data between front- and backend I'm using the Axios library, which usually works pretty fine.
The Problem:
The image looks like this in the (Chrome) browser console:
It's a very very long alphanumeric string and that's what I send to the server with the following code:
ANSWER
Answered 2017-Nov-30 at 10:33I've finally found an answer on my own!
I think the problem was that I used the e.target.result
(which is used to show the image on the frontend) but insted I had to use the JS File object. The standard HTML 5 file input fields return those File objects (as I've read here).
The only thing I had to do now is to make a FormData object, append the File Object, set the FormData as Body and set the Content-Type header and that's it!
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install spring-mvc-ajax
You can use spring-mvc-ajax like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the spring-mvc-ajax component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page