A
A
A person from Kazakhstan2016-08-14 10:25:46
PHP
A person from Kazakhstan, 2016-08-14 10:25:46

How is json created and generated?

I didn’t find an explanation on the net how it is created and how it is then generated, for example, a store: is it possible that some person sits and creates it and then makes entries into it himself ??

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dev400, 2016-08-14
@LenovoId

https://ru.wikipedia.org/wiki/JSON
https://learn.javascript.ru/json
php.net/manual/ru/book.json.php

N
Nikolay Baranenko, 2016-08-15
@drno-reg

Example of getting JSON on JSP

<%@ taglib prefix="json" uri="http://www.atg.com/taglibs/json" %>

    <sql:query var="rs" dataSource="jdbc/ORACLE">
    SELECT
    to_char(r.TIME_STAMP, 'dd.mm.yyyy hh24:mi:ss') AS TIME_STAMP,
    r.NAME                       AS COUNTER,
    r.VALUE
    FROM
    profile_new r
    WHERE
    TIME_STAMP > to_date('25.07.2016 02:30:00', 'dd.mm.yyyy hh24:mi:ss')
    and  TIME_STAMP < to_date('25.07.2016 02:35:00', 'dd.mm.yyyy hh24:mi:ss')
    order by time_stamp
    </sql:query>
    <c:set var="json_text" scope="application">
    <json:array name="rows" prettyPrint="false">
    <c:forEach var="row" items="${rs.rows}">
    <json:object>
        <json:property name="TIME_STAMP" value="${row.TIME_STAMP}"/>
        <json:property name="COUNTER" value="${row.COUNTER}"/>
        <json:property name="VALUE" value="${row.VALUE}"/>
    </json:object>
    </c:forEach>
    </json:array>
    </c:set>

Result Example
The great advantage of this "string" is that it is easily unmarshaled.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question