JavaSpringBoot:如何为依赖项请求启用分页
我正在用Spring Boot构建一个RESTAPI。问题很简单,我如何为依赖项请求启用分页 这说明了结果如何查找非依赖项请求JavaSpringBoot:如何为依赖项请求启用分页,java,spring,rest,spring-boot,Java,Spring,Rest,Spring Boot,我正在用Spring Boot构建一个RESTAPI。问题很简单,我如何为依赖项请求启用分页 这说明了结果如何查找非依赖项请求http://localhost:8080/dimensionAttributes: { "_embedded" : { "dimensionAttribute" : [ { "name" : "SollFreitag", "description" : "Sollstunden Freitags", "dataType"
http://localhost:8080/dimensionAttributes
:
{
"_embedded" : {
"dimensionAttribute" : [ {
"name" : "SollFreitag",
"description" : "Sollstunden Freitags",
"dataType" : "DEC",
"hasHistory" : true,
"hasTrigger" : null,
"allowInterface" : true,
"readOnly" : null,
"discrete" : null,
"mandatory" : false,
"_links" : {
"self" : {
"href" : "http://localhost:8080/dimensionAttributes/20"
},
"dimensionAttribute" : {
"href" : "http://localhost:8080/dimensionAttributes/20"
},
"dimension" : {
"href" : "http://localhost:8080/dimensionAttributes/20/dimension"
},
"dimensionAttributeValue" : {
"href" : "http://localhost:8080/dimensionAttributes/20/dimensionAttributeValue"
}
}
} ]
},
"_links" : {
"first" : {
"href" : "http://localhost:8080/dimensionAttributes?page=0&size=20"
},
"self" : {
"href" : "http://localhost:8080/dimensionAttributes{?page,size,sort}",
"templated" : true
},
"next" : {
"href" : "http://localhost:8080/dimensionAttributes?page=1&size=20"
},
"last" : {
"href" : "http://localhost:8080/dimensionAttributes?page=1&size=20"
},
"profile" : {
"href" : "http://localhost:8080/profile/dimensionAttributes"
},
"search" : {
"href" : "http://localhost:8080/dimensionAttributes/search"
}
},
"page" : {
"size" : 20,
"totalElements" : 35,
"totalPages" : 2,
"number" : 0
}
}
但是运行依赖项请求(在本例中为“dimensionAttributeValue”)http://localhost:8080/dimensionAttributes/20/dimensionAttributeValue,页面
部分以及下一个
url和其他链接丢失
{
"_embedded" : {
"dimensionAttributeValue" : [ {
"chrValue" : "Mihal, Matus",
"intValue" : null,
"decValue" : null,
"datValue" : null,
"startDate" : null,
"_links" : {
"self" : {
"href" : "http://localhost:8080/dimensionAttributeValues/18993"
},
"dimensionAttributeValue" : {
"href" : "http://localhost:8080/dimensionAttributeValues/18993"
},
"lstValue" : {
"href" : "http://localhost:8080/dimensionAttributeValues/18993/lstValue"
},
"dimensionAttribute" : {
"href" : "http://localhost:8080/dimensionAttributeValues/18993/dimensionAttribute"
},
"masterData" : {
"href" : "http://localhost:8080/dimensionAttributeValues/18993/masterData"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/dimensionAttributes/1/dimensionAttributeValue?page=0,&size=1"
}
}
}
你能提供你的控制器类和资源汇编类吗?我没有写控制器类,汇编类是什么?不,我可以检索很多dimensionAttributeValue对象。可能有几百个。仔细看一看:{“\u embedded”:{“dimensionAttributeValue”:[许多对象都是可能的],…]}