[OLINGO-713] Minor fix in batch tutorial

This commit is contained in:
mibo 2016-11-16 20:19:46 +01:00
parent 69659a1a90
commit ecf9b9f9ba
2 changed files with 26 additions and 12 deletions

View File

@ -29,15 +29,29 @@
<name>${project.artifactId}-Webapp</name>
<build>
<finalName>DemoService</finalName>
</build>
<properties>
<javax.version>2.5</javax.version>
<odata.version>4.4.0-SNAPSHOT</odata.version>
<slf4j.version>1.7.7</slf4j.version>
<project.source>1.6</project.source>
<compiler.plugin.version>3.2</compiler.plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<properties>
<javax.version>2.5</javax.version>
<odata.version>4.4.0-SNAPSHOT</odata.version>
<slf4j.version>1.7.7</slf4j.version>
</properties>
<build>
<finalName>DemoService</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${compiler.plugin.version}</version>
<configuration>
<source>${project.source}</source>
<target>${project.source}</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>

View File

@ -122,12 +122,12 @@ public class DemoBatchProcessor implements BatchProcessor {
responseParts.add(facade.handleBatchRequest(part));
}
// 5. Serialize the response content
final InputStream responseContent = odata.createFixedFormatSerializer().batchResponse(responseParts, boundary);
// 6. Create a new boundary for the response
// 5. Create a new boundary for the response
final String responseBoundary = "batch_" + UUID.randomUUID().toString();
// 6. Serialize the response content
final InputStream responseContent = odata.createFixedFormatSerializer().batchResponse(responseParts, responseBoundary);
// 7. Setup response
response.setHeader(HttpHeader.CONTENT_TYPE, ContentType.MULTIPART_MIXED + ";boundary=" + responseBoundary);
response.setContent(responseContent);