Featured
-
How to split a String
Below I have written a code to split a string.
by shahbaz.ahmmod -
Send Push Notification with Custom Data to iPhone device from Java Server Side
This blog will help you to send Push Notifications
by babita.dhami -
Tomcat and Eclipse Integration Error : “Unknown version of Tomcat was specified”
If you are adding Server in Eclipse for Tomcat, an
by chandan.ahluwalia -
Spring MVC and MongoDB
Repository Class Using MongoDB : Spring has th
by sumit.vyas -
How to create DLL file from java?
Hello Guy's This Blog will guide how to create D
by bhagwan.khichar
Tags
Getting object values from json data
Getting object values from Json:
If you have a data in Json format and you need to retrieve the object values from that day, it can be easily done using Java.
Lets see an example,
If you are using maven add the following ...
Creating object in Json format using java
Json object:
You easily write your object in json format with java . Json format is used because it becomes easy to exchange information in this form. It is easy to understand and easy to write.
Lets see an example,
If yo...
Convert Xml to Json format using java
Xml to Json conversion:
Lets see with the help of example.
Following jars are required for conversion:
apache-commmons
json-lib
ezmorph
Suppose we have the xml file with name demo.xml with the following data:
...
Send data through ajax call and receive Json response from controller in Springs
Here is the sample code implementing ajax call to send the data of a form to the controller and receiving json response from controller.
Student.java
Create a java bean class and generate setter and getter.
public class Student
{
...
Read the Specific JSON Property
The below Example will show you how to read the specific property from the file in JSON format or to read the Specific property from the JSON data.
emp.txt
{
"id": 123,
"name": "Manish",
"phone": [
123456,
987654
],
...
Sample application using JQuery, Spring MVC @RequestBody and JSON together
See the below steps to create sample application using JQuery, Spring MVC @RequestBody and JSON :
1- Define dependency for Spring, JSON in pom.xml as below:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/...
How to convert Model Object into JSON string and JSON string into Model Object in Java?
Sometimes we need to get JSON string direct from Model object and to read JSON values from Model object. We can do this functionality very easily by using Jackson Mapper.
Follow to steps in order to do conversion from Model Object to JSON stri...
Read and Write JSON data in MySQL
Store JSON in MYSQL:- Here below snippet will show you how we can store json data in mysql and read the json data from mysql and convert into a java object. Remember that the field where you can store the JSON data in mysql to set data type of t...
How to iterate Object List in JavaScript
Sometimes we need to send data from Controller to JSp. Here I'm going to explain how we can send and iterate Object List in JSP file. You can do this easily by following the below steps:
1- Define the below dependency in you pom.xml file for...