Repository: olingo-odata4 Updated Branches: refs/heads/master 69659a1a9 -> ecf9b9f9b
[OLINGO-713] Minor fix in batch tutorial Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/ecf9b9f9 Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/ecf9b9f9 Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/ecf9b9f9 Branch: refs/heads/master Commit: ecf9b9f9ba25a63834f418b3a7a71e98daab7e90 Parents: 69659a1 Author: mibo <[email protected]> Authored: Wed Nov 16 20:19:46 2016 +0100 Committer: mibo <[email protected]> Committed: Wed Nov 16 20:19:56 2016 +0100 ---------------------------------------------------------------------- samples/tutorials/p11_batch/pom.xml | 28 +++++++++++++++----- .../mynamespace/service/DemoBatchProcessor.java | 8 +++--- 2 files changed, 25 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/ecf9b9f9/samples/tutorials/p11_batch/pom.xml ---------------------------------------------------------------------- diff --git a/samples/tutorials/p11_batch/pom.xml b/samples/tutorials/p11_batch/pom.xml index 4b6cc26..2016b0b 100644 --- a/samples/tutorials/p11_batch/pom.xml +++ b/samples/tutorials/p11_batch/pom.xml @@ -29,16 +29,30 @@ <name>${project.artifactId}-Webapp</name> - <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> + + <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> - <properties> - <javax.version>2.5</javax.version> - <odata.version>4.4.0-SNAPSHOT</odata.version> - <slf4j.version>1.7.7</slf4j.version> - </properties> - <dependencies> <dependency> <groupId>javax.servlet</groupId> http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/ecf9b9f9/samples/tutorials/p11_batch/src/main/java/myservice/mynamespace/service/DemoBatchProcessor.java ---------------------------------------------------------------------- diff --git a/samples/tutorials/p11_batch/src/main/java/myservice/mynamespace/service/DemoBatchProcessor.java b/samples/tutorials/p11_batch/src/main/java/myservice/mynamespace/service/DemoBatchProcessor.java index 49da784..4813ea0 100644 --- a/samples/tutorials/p11_batch/src/main/java/myservice/mynamespace/service/DemoBatchProcessor.java +++ b/samples/tutorials/p11_batch/src/main/java/myservice/mynamespace/service/DemoBatchProcessor.java @@ -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);
