1

I want to develop a code which can take json object from the json file and bind it to Html page using java code .I have searched through browser i dint get the solution.Please give me suggestion to solve this issue.

I have the json file.

{

    "policyN": "D800026158",
    "policyStartDate": "23-Nov-2017",
    "policyEndDate": "22-Nov-2018",
    "policyIssueDate": "23-Nov-2017",
    "agent": {
        "agentCode": "100006767676702",
        "agentName": "ZInsurance Limited",
        "agentEmail": "[email protected]"
    }   
}

If i select PolicyN i should get all the informatiom which is having in json file.

I have tried by using this code

PojoMobile myObjects = mapper.readValue(new File("D:/godigit_doc/MobileJsonNew.json"), PojoMobile.class);

System.out.println(".=agentCode=."+myObjects.getAgent().getAgentCode());
System.out.println(".=agentEmail=."+myObjects.getAgent().getAgentEmail());

Pojo class is :

public class PojoMobile {

    private String policyNumber;

    private String policyStartDate;

    private String policyEndDate;

    private String policyIssueDate;

    private Agent agent;

    public String getPolicyNumber() {
        return policyNumber;
    }

    public void setPolicyNumber(String policyNumber) {
        this.policyNumber = policyNumber;
    }

    public String getPolicyStartDate() {
        return policyStartDate;
    }

    public void setPolicyStartDate(String policyStartDate) {
        this.policyStartDate = policyStartDate;
    }

    public String getPolicyEndDate() {
        return policyEndDate;
    }

    public void setPolicyEndDate(String policyEndDate) {
        this.policyEndDate = policyEndDate;
    }

    public String getPolicyIssueDate() {
        return policyIssueDate;
    }

    public void setPolicyIssueDate(String policyIssueDate) {
        this.policyIssueDate = policyIssueDate;
    }

    public Agent getAgent() {
        return agent;
    }

    public void setAgent(Agent agent) {
        this.agent = agent;
    }
}

I can able to get the value but im not able to bind the output to Html page.Please Help me .Thanks In advance

3
  • 1
    Possible duplicate of Bind JSON object to HTML element Commented Dec 13, 2017 at 9:41
  • where your html ? Commented Dec 13, 2017 at 10:01
  • <tr> <td style="border-right: dashed 0px #BBBBBB;"><p style="font-family: 'Muli', sans-serif; font-size:14px;color:#BBBBBB;font-weight:400;margin:0px;text-align:left;" ><VALUE-OF>row["PolicyN"]</VALUE-OF></p></td> </tr> Commented Dec 13, 2017 at 10:14

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.