首页 \ 问答 \ 我怎样才能达到这个使用jackson jsonNode并获得所需的输出(How can I achieve this using jackson jsonNode and get the desired output)

我怎样才能达到这个使用jackson jsonNode并获得所需的输出(How can I achieve this using jackson jsonNode and get the desired output)

Json回应

{
    "searchResults": {
        "@xmlns": {
            "dvi": "http://localhsot.com/ns/1.0",
            "$": "http://localhsot.com/ns/1.0",
            "a": "http://alternate.localhsot.com/ns/1.0"
        },
        "@totalCount": "2",
        "file": [
            {
                "link": [
                    {
                        "@rel": "file",
                        "$": "file.url"
                    },
                    {
                        "@rel": "content",
                        "$": "content.url"
                    },
                    {
                        "@rel": "repository",
                        "$": "repository.url"
                    },
                    {
                        "@rel": "content.alternate",
                        "@a:width": "320",
                        "@a:height": "320",
                        "@a:imageFormat": "jpeg",
                        "@a:mimeType": "image/jpeg",
                        "@a:size": "-1",
                        "$": "some.url"
                    },
                    {
                        "@rel": "content.alternate",
                        "@a:width": "64",
                        "@a:height": "64",
                        "@a:imageFormat": "jpeg",
                        "@a:mimeType": "image/jpeg",
                        "@a:size": "-1",
                        "$": "some.url"
                    },
                    {
                        "@rel": "content.alternate",
                        "@a:width": "24",
                        "@a:height": "24",
                        "@a:imageFormat": "jpeg",
                        "@a:mimeType": "image/jpeg",
                        "@a:size": "-1",
                        "$": "some.url"
                    },
                    {
                        "@rel": "content.alternate",
                        "@a:width": "128",
                        "@a:height": "128",
                        "@a:imageFormat": "jpeg",
                        "@a:mimeType": "image/jpeg",
                        "@a:size": "-1",
                        "$": "some.url"
                    }
                ],
                "name": {
                    "$": "gullfoss.jpg"
                },
                "parentPath": {
                    "$": "/"
                },
                "size": {
                    "$": "91345"
                },
                "versionCreated": {
                    "$": "2017-01-13T16:38:20.059Z"
                },
                "systemAttribute": [
                    {
                        "@name": "Geo-Latitude",
                        "$": "47.6065"
                    },
                    {
                        "@name": "Geo-Longitude",
                        "$": "22.99514"
                    },
                    {
                        "@name": "Height",
                        "$": "579"
                    },
                    {
                        "@name": "Mime-Type",
                        "$": "image/jpeg"
                    },
                    {
                        "@name": "Timeline-Date",
                        "$": "-0091-03-27T04:26:40.000Z"
                    },
                    {
                        "@name": "Width",
                        "$": "680"
                    }
                ],
                "attributesChanged": {
                    "$": "false"
                },
                "deleted": {
                    "$": "false"
                },
                "repository": {
                    "$": "VZMOBILE_13psb6j"
                },
                "checksum": {
                    "$": "5d828c1d94b2569ff1bf60a9ebe9cd2de8ae8e6a9ad7d77d678c1766c78957c5"
                },
                "extension": {
                    "$": "jpg"
                },
                "fileAttribute": [
                    {
                        "@name": "ContentPermissions",
                        "$": "SHARE"
                    },
                    {
                        "@name": "Width",
                        "$": "680"
                    },
                    {
                        "@name": "CI_COMPLETE",
                        "$": "true"
                    },
                    {
                        "@name": "DRM_PROTECTED",
                        "$": "false"
                    },
                    {
                        "@name": "Height",
                        "$": "579"
                    }
                ],
                "contentToken": {
                    "$": "AHYLsb1sK9iy1Rn3yS4mQiM5pFL--AyTjY3i5G-zzdOm68QzB_GILrt1pXgfdEkUcPZZ5tUpn1Ih3j9wyfywIVY~"
                },
                "contentAccessible": {
                    "$": "true"
                },
                "contentChanged": {
                    "$": "false"
                }
            },
            {
                "link": [
                    {
                        "@rel": "file",
                        "$": "file.url"
                    },
                    {
                        "@rel": "content",
                        "$": "content.url"
                    },
                    {
                        "@rel": "repository",
                        "$": "repository.url"
                    },
                    {
                        "@rel": "content.alternate",
                        "@a:width": "320",
                        "@a:height": "320",
                        "@a:imageFormat": "jpeg",
                        "@a:mimeType": "image/jpeg",
                        "@a:size": "-1",
                        "$": "some.url"
                    },
                    {
                        "@rel": "content.alternate",
                        "@a:width": "64",
                        "@a:height": "64",
                        "@a:imageFormat": "jpeg",
                        "@a:mimeType": "image/jpeg",
                        "@a:size": "-1",
                        "$": "some.url"
                    },
                    {
                        "@rel": "content.alternate",
                        "@a:width": "24",
                        "@a:height": "24",
                        "@a:imageFormat": "jpeg",
                        "@a:mimeType": "image/jpeg",
                        "@a:size": "-1",
                        "$": "some.url"
                    },
                    {
                        "@rel": "content.alternate",
                        "@a:width": "128",
                        "@a:height": "128",
                        "@a:imageFormat": "jpeg",
                        "@a:mimeType": "image/jpeg",
                        "@a:size": "-1",
                        "$": "some.url"
                    }
                ],
                "name": {
                    "$": "gullfoss.jpg"
                },
                "parentPath": {
                    "$": "/Folder"
                },
                "size": {
                    "$": "91345"
                },
                "versionCreated": {
                    "$": "2017-01-13T16:38:59.728Z"
                },
                "systemAttribute": [
                    {
                        "@name": "Geo-Latitude",
                        "$": "47.6065"
                    },
                    {
                        "@name": "Geo-Longitude",
                        "$": "22.99514"
                    },
                    {
                        "@name": "Height",
                        "$": "579"
                    },
                    {
                        "@name": "Mime-Type",
                        "$": "image/jpeg"
                    },
                    {
                        "@name": "Timeline-Date",
                        "$": "-0091-03-27T04:26:40.000Z"
                    },
                    {
                        "@name": "Width",
                        "$": "680"
                    }
                ],
                "attributesChanged": {
                    "$": "false"
                },
                "deleted": {
                    "$": "false"
                },
                "repository": {
                    "$": "VZMOBILE_13psb6j"
                },
                "checksum": {
                    "$": "5d828c1d94b2569ff1bf60a9ebe9cd2de8ae8e6a9ad7d77d678c1766c78957c5"
                },
                "extension": {
                    "$": "jpg"
                },
                "fileAttribute": [
                    {
                        "@name": "ContentPermissions",
                        "$": "SHARE"
                    },
                    {
                        "@name": "Width",
                        "$": "680"
                    },
                    {
                        "@name": "CI_COMPLETE",
                        "$": "true"
                    },
                    {
                        "@name": "DRM_PROTECTED",
                        "$": "false"
                    },
                    {
                        "@name": "Height",
                        "$": "579"
                    }
                ],
                "contentToken": {
                    "$": "AHYLsb1sK9iy1Rn3yS4mQiM5pFL--AyTjY3i5G-zzdOm68QzB_GILrt1pXgfdEkUcPZZ5tUpn1Ih3j9wyfywIVY~"
                },
                "contentAccessible": {
                    "$": "true"
                },
                "contentChanged": {
                    "$": "false"
                }
            }
        ]
    }
}

现在,我想通过浏览这个json响应来检查两个条件,即首先从上面的json字符串中获取@totalCount

第二个条件,遍历每个文件节点并查看

if(myrepoName.equals(json response repository name))然后从链接节点获取存储库的内容url。

{
    "@rel": "content",
    "$": "content.url"  <---
}

我的代码:

try {
    JsonNode jsonNode = new ObjectMapper().readTree(response.prettyPrint());
    int totalCount = jsonNode.at("/searchResults/@totalCount").asInt();
    logger.info("Search returned " + totalCount + " results");
    if(totalCount > 0) {
        JsonNode filesNode = jsonNode.at("/searchResults/file");
        logger.info("Result: " + filesNode);
        if(filesNode.isObject()) {
            Iterator<JsonNode> filesIterator = filesNode.elements();
            while (filesIterator.hasNext())
            {
                // what i'm trying to get here is this
                JsonNode fileNode = filesIterator.next();
                Object name = fileNode.at("/$").asText();
                if (repoName.equals(name)) {
                    logger.info("Got it");
                    //get the content URL from link node
                    //missing code 
                    logger.info("Returning " + contentURL + " for repo " + repoName);
                    break;
                }
            }
        }
    }
} catch (IOException e) {
    e.printStackTrace();
}

Json response

{
    "searchResults": {
        "@xmlns": {
            "dvi": "http://localhsot.com/ns/1.0",
            "$": "http://localhsot.com/ns/1.0",
            "a": "http://alternate.localhsot.com/ns/1.0"
        },
        "@totalCount": "2",
        "file": [
            {
                "link": [
                    {
                        "@rel": "file",
                        "$": "file.url"
                    },
                    {
                        "@rel": "content",
                        "$": "content.url"
                    },
                    {
                        "@rel": "repository",
                        "$": "repository.url"
                    },
                    {
                        "@rel": "content.alternate",
                        "@a:width": "320",
                        "@a:height": "320",
                        "@a:imageFormat": "jpeg",
                        "@a:mimeType": "image/jpeg",
                        "@a:size": "-1",
                        "$": "some.url"
                    },
                    {
                        "@rel": "content.alternate",
                        "@a:width": "64",
                        "@a:height": "64",
                        "@a:imageFormat": "jpeg",
                        "@a:mimeType": "image/jpeg",
                        "@a:size": "-1",
                        "$": "some.url"
                    },
                    {
                        "@rel": "content.alternate",
                        "@a:width": "24",
                        "@a:height": "24",
                        "@a:imageFormat": "jpeg",
                        "@a:mimeType": "image/jpeg",
                        "@a:size": "-1",
                        "$": "some.url"
                    },
                    {
                        "@rel": "content.alternate",
                        "@a:width": "128",
                        "@a:height": "128",
                        "@a:imageFormat": "jpeg",
                        "@a:mimeType": "image/jpeg",
                        "@a:size": "-1",
                        "$": "some.url"
                    }
                ],
                "name": {
                    "$": "gullfoss.jpg"
                },
                "parentPath": {
                    "$": "/"
                },
                "size": {
                    "$": "91345"
                },
                "versionCreated": {
                    "$": "2017-01-13T16:38:20.059Z"
                },
                "systemAttribute": [
                    {
                        "@name": "Geo-Latitude",
                        "$": "47.6065"
                    },
                    {
                        "@name": "Geo-Longitude",
                        "$": "22.99514"
                    },
                    {
                        "@name": "Height",
                        "$": "579"
                    },
                    {
                        "@name": "Mime-Type",
                        "$": "image/jpeg"
                    },
                    {
                        "@name": "Timeline-Date",
                        "$": "-0091-03-27T04:26:40.000Z"
                    },
                    {
                        "@name": "Width",
                        "$": "680"
                    }
                ],
                "attributesChanged": {
                    "$": "false"
                },
                "deleted": {
                    "$": "false"
                },
                "repository": {
                    "$": "VZMOBILE_13psb6j"
                },
                "checksum": {
                    "$": "5d828c1d94b2569ff1bf60a9ebe9cd2de8ae8e6a9ad7d77d678c1766c78957c5"
                },
                "extension": {
                    "$": "jpg"
                },
                "fileAttribute": [
                    {
                        "@name": "ContentPermissions",
                        "$": "SHARE"
                    },
                    {
                        "@name": "Width",
                        "$": "680"
                    },
                    {
                        "@name": "CI_COMPLETE",
                        "$": "true"
                    },
                    {
                        "@name": "DRM_PROTECTED",
                        "$": "false"
                    },
                    {
                        "@name": "Height",
                        "$": "579"
                    }
                ],
                "contentToken": {
                    "$": "AHYLsb1sK9iy1Rn3yS4mQiM5pFL--AyTjY3i5G-zzdOm68QzB_GILrt1pXgfdEkUcPZZ5tUpn1Ih3j9wyfywIVY~"
                },
                "contentAccessible": {
                    "$": "true"
                },
                "contentChanged": {
                    "$": "false"
                }
            },
            {
                "link": [
                    {
                        "@rel": "file",
                        "$": "file.url"
                    },
                    {
                        "@rel": "content",
                        "$": "content.url"
                    },
                    {
                        "@rel": "repository",
                        "$": "repository.url"
                    },
                    {
                        "@rel": "content.alternate",
                        "@a:width": "320",
                        "@a:height": "320",
                        "@a:imageFormat": "jpeg",
                        "@a:mimeType": "image/jpeg",
                        "@a:size": "-1",
                        "$": "some.url"
                    },
                    {
                        "@rel": "content.alternate",
                        "@a:width": "64",
                        "@a:height": "64",
                        "@a:imageFormat": "jpeg",
                        "@a:mimeType": "image/jpeg",
                        "@a:size": "-1",
                        "$": "some.url"
                    },
                    {
                        "@rel": "content.alternate",
                        "@a:width": "24",
                        "@a:height": "24",
                        "@a:imageFormat": "jpeg",
                        "@a:mimeType": "image/jpeg",
                        "@a:size": "-1",
                        "$": "some.url"
                    },
                    {
                        "@rel": "content.alternate",
                        "@a:width": "128",
                        "@a:height": "128",
                        "@a:imageFormat": "jpeg",
                        "@a:mimeType": "image/jpeg",
                        "@a:size": "-1",
                        "$": "some.url"
                    }
                ],
                "name": {
                    "$": "gullfoss.jpg"
                },
                "parentPath": {
                    "$": "/Folder"
                },
                "size": {
                    "$": "91345"
                },
                "versionCreated": {
                    "$": "2017-01-13T16:38:59.728Z"
                },
                "systemAttribute": [
                    {
                        "@name": "Geo-Latitude",
                        "$": "47.6065"
                    },
                    {
                        "@name": "Geo-Longitude",
                        "$": "22.99514"
                    },
                    {
                        "@name": "Height",
                        "$": "579"
                    },
                    {
                        "@name": "Mime-Type",
                        "$": "image/jpeg"
                    },
                    {
                        "@name": "Timeline-Date",
                        "$": "-0091-03-27T04:26:40.000Z"
                    },
                    {
                        "@name": "Width",
                        "$": "680"
                    }
                ],
                "attributesChanged": {
                    "$": "false"
                },
                "deleted": {
                    "$": "false"
                },
                "repository": {
                    "$": "VZMOBILE_13psb6j"
                },
                "checksum": {
                    "$": "5d828c1d94b2569ff1bf60a9ebe9cd2de8ae8e6a9ad7d77d678c1766c78957c5"
                },
                "extension": {
                    "$": "jpg"
                },
                "fileAttribute": [
                    {
                        "@name": "ContentPermissions",
                        "$": "SHARE"
                    },
                    {
                        "@name": "Width",
                        "$": "680"
                    },
                    {
                        "@name": "CI_COMPLETE",
                        "$": "true"
                    },
                    {
                        "@name": "DRM_PROTECTED",
                        "$": "false"
                    },
                    {
                        "@name": "Height",
                        "$": "579"
                    }
                ],
                "contentToken": {
                    "$": "AHYLsb1sK9iy1Rn3yS4mQiM5pFL--AyTjY3i5G-zzdOm68QzB_GILrt1pXgfdEkUcPZZ5tUpn1Ih3j9wyfywIVY~"
                },
                "contentAccessible": {
                    "$": "true"
                },
                "contentChanged": {
                    "$": "false"
                }
            }
        ]
    }
}

Now, I want to check two condition by travesing this json response i.e., First get the @totalCount from the above json string

second condition, loop through each file node and see

if(myrepoName.equals(json response repository name) then get the content url for repository from link node. which is this

{
    "@rel": "content",
    "$": "content.url"  <---
}

My Code:

try {
    JsonNode jsonNode = new ObjectMapper().readTree(response.prettyPrint());
    int totalCount = jsonNode.at("/searchResults/@totalCount").asInt();
    logger.info("Search returned " + totalCount + " results");
    if(totalCount > 0) {
        JsonNode filesNode = jsonNode.at("/searchResults/file");
        logger.info("Result: " + filesNode);
        if(filesNode.isObject()) {
            Iterator<JsonNode> filesIterator = filesNode.elements();
            while (filesIterator.hasNext())
            {
                // what i'm trying to get here is this
                JsonNode fileNode = filesIterator.next();
                Object name = fileNode.at("/$").asText();
                if (repoName.equals(name)) {
                    logger.info("Got it");
                    //get the content URL from link node
                    //missing code 
                    logger.info("Returning " + contentURL + " for repo " + repoName);
                    break;
                }
            }
        }
    }
} catch (IOException e) {
    e.printStackTrace();
}

原文:https://stackoverflow.com/questions/41655924
更新时间:2022-07-28 08:07

最满意答案

你将C样式字符串( char指针)传递给std::istringstream构造函数,它实际上实例化了一个std::string并传递了它。 这是由于隐式转换而发生的。 std::string的转换构造函数将C样式字符串中的空字节字符解释为字符串终止符的结尾,从而导致忽略它后面的所有字符。

为了避免这种情况,您可以显式构造一个std::string指定数据的大小并将其传递给std::istringstream

char bin[] = {0x30, 0xb, 0x0, 0x6, 0x6, 0x2b, 0xc, 0x89, 0x36, 0x84, 0x13, 0xa, 0x1};
std::istringstream strm(std::string(bin, sizeof(bin) / sizeof(bin[0])));




注意:我不确切知道你要完成什么,但我建议使用std::vector而不是原始字符缓冲区。


What you pass a C style string (char pointer) to the std::istringstream constructor it actually instantiates a std::string and passes that instead. This happens due to an implicit conversion. The conversion constructor of std::string interprets a null byte character in C style strings as an end of string terminator causing all characters after it to be ignored.

To avoid this you can explicitly construct a std::string specifying the size of the data and pass it to std::istringstream

char bin[] = {0x30, 0xb, 0x0, 0x6, 0x6, 0x2b, 0xc, 0x89, 0x36, 0x84, 0x13, 0xa, 0x1};
std::istringstream strm(std::string(bin, sizeof(bin) / sizeof(bin[0])));




Note: I don't know exactly what you are trying to accomplish but I recommend using std::vector instead of a raw character buffer if possible.

相关问答

更多
  • 这对我有用: library(httr) url <- "ftp://arthurhou.pps.eosdis.nasa.gov/gpmdata/2014/04/01/imerg/3B-HHR.MS.MRG.3IMERG.20140401-S150000-E152959.0900.V03D.HDF5" output_file <- "3B-HHR.MS.MRG.3IMERG.20140401-S150000-E152959.0900.V03D.HDF5" my_email <- "someone@ex ...
  • 是的,你可以在std::string嵌入空值。 例: std::string s; s.push_back('\0'); s.push_back('a'); assert(s.length() == 2); 注意: std::string的c_str()成员将总是在返回的字符缓冲区附加一个空字符; 但是, std::string的data()成员可能会或可能不会向返回的char缓冲区追加空字符。 小心操作员+ = 有一点需要注意的是在RHS上不要使用operator+=和char* 。 它只会加起来,直到 ...
  • 一位同事为我提供了解决方法。 仍然不知道为什么查询忽略NULLS LAST,但我最终使用这个作为我的解决方法: String sql = "SELECT c FROM Contact c WHERE c.partnerCode =:pCode and c.activeFlag='Y'" +" ORDER BY nvl(c.primaryFlag, 'N') DESC, c.lastName ASC"; 注意:该列的值为'Y','N'或null。 使用nvl我使用'N'来代 ...
  • 您可以使用jOOλ (一种扩展Java 8流,用于单线程,顺序流用例)的库: Seq.seq(lazyFileStream) // Seq .zipWithIndex() // Seq> .groupBy(tuple -> tuple.v2 / 500) // Map> .forEach((index, batch) -> { ...
  • 你将C样式字符串( char指针)传递给std::istringstream构造函数,它实际上实例化了一个std::string并传递了它。 这是由于隐式转换而发生的。 std::string的转换构造函数将C样式字符串中的空字节字符解释为字符串终止符的结尾,从而导致忽略它后面的所有字符。 为了避免这种情况,您可以显式构造一个std::string指定数据的大小并将其传递给std::istringstream char bin[] = {0x30, 0xb, 0x0, 0x6, 0x6, 0x2b, 0xc ...
  • 您可以使用StreamConverters实用程序从java.io流中获取Source和Sink 。 更多信息在这里 。 您可以使用flatMapConcat或flatMapMerge将Source s流flatMapMerge为单个流。 更多信息在这里 。 一个简单的例子可能是: val source: Source[String, NotUsed] = ??? def gimmeInputStream(name: String): InputStream = ??? val processi ...
  • 我的理解是,使用像Storm这样的框架的目的是从应用程序/ Web服务器卸载繁重的处理(无论是cpu绑定,I / O绑定还是两者)并保持响应。 考虑每个应用程序服务器可能必须提供大量并发请求,而不是所有这些请求都与流处理有关。 如果应用服务器已经处理了大量事件,那么它可能构成较轻请求的瓶颈,因为服务器资源(认为CPU使用,内存,磁盘争用等)已经与更重的处理请求相关联。 如果您需要面对的实际负载不是那么重,或者只是通过添加应用服务器实例来处理,那么当然没有必要复杂化您的架构/拓扑,这实际上可能会减慢整个事情发 ...
  • 减少或其可变变体collect ,始终是处理所有项目的操作。 您的操作可以通过自定义Spliterator ,例如 public static Stream joinGroups(Stream s) { Spliterator sp=s.spliterator(); return StreamSupport.stream( new Spliterators.AbstractSpliterator(sp.estim ...
  • 在你的catch中,不要返回Observable.throw ,那么它应该按照需要继续流。 如果要将信息传播到外部流,可以使用return Observable.of("Error: Foo.Bar"); 例如。 或者在catch记录错误并返回一个Observable.empty()以使外部流基本上忽略该错误。 换句话说,只是链接这个: .catch(error => Rx.Observable.of(error)); const stream$ = Rx.Observable.range(1, 5) ...
  • 嵌入null的字符串示例如下: var example = "This is a null: \0"; '\0'是Unicode字符'NULL'(U + 0000) 。 An example of a string with an embedded null is: var example = "This is a null: \0"; '\0' is the Unicode character 'NULL' (U+0000).

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)