struts git commit: WW-4547 - Rest showcase does not show the validation result

2015-09-10 Thread jogep
Repository: struts
Updated Branches:
  refs/heads/master 4286d6a9d -> e10658cb3


WW-4547 - Rest showcase does not show the validation result


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/e10658cb
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/e10658cb
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/e10658cb

Branch: refs/heads/master
Commit: e10658cb3cff6dc7e2df776fb85235337c805ceb
Parents: 4286d6a
Author: Johannes Geppert 
Authored: Thu Sep 10 17:37:41 2015 +0200
Committer: Johannes Geppert 
Committed: Thu Sep 10 17:37:41 2015 +0200

--
 .../main/webapp/WEB-INF/content/orders-deleteConfirm.jsp| 2 ++
 .../src/main/webapp/WEB-INF/content/orders-edit.jsp | 8 
 .../src/main/webapp/WEB-INF/content/orders-editNew.jsp  | 9 -
 .../src/main/webapp/WEB-INF/content/orders-index.jsp| 2 ++
 .../src/main/webapp/WEB-INF/content/orders-show.jsp | 2 ++
 apps/rest-showcase/src/main/webapp/css/app.css  | 5 +
 6 files changed, 27 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/struts/blob/e10658cb/apps/rest-showcase/src/main/webapp/WEB-INF/content/orders-deleteConfirm.jsp
--
diff --git 
a/apps/rest-showcase/src/main/webapp/WEB-INF/content/orders-deleteConfirm.jsp 
b/apps/rest-showcase/src/main/webapp/WEB-INF/content/orders-deleteConfirm.jsp
index 4ca2487..98f3c39 100644
--- 
a/apps/rest-showcase/src/main/webapp/WEB-INF/content/orders-deleteConfirm.jsp
+++ 
b/apps/rest-showcase/src/main/webapp/WEB-INF/content/orders-deleteConfirm.jsp
@@ -8,6 +8,8 @@
 
 Orders
 
+
+
 
 
 
 
 
 
 
 
 
 
 

struts git commit: WW-4545 - Setting status code in HttpHeaders will be ignored

2015-09-10 Thread jogep
Repository: struts
Updated Branches:
  refs/heads/master e10658cb3 -> 4cd9a74cb


WW-4545 - Setting status code in HttpHeaders will be ignored


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/4cd9a74c
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/4cd9a74c
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/4cd9a74c

Branch: refs/heads/master
Commit: 4cd9a74cb8efa8dc0d3c57ac267a70b0538f3bf0
Parents: e10658c
Author: Johannes Geppert 
Authored: Thu Sep 10 19:11:12 2015 +0200
Committer: Johannes Geppert 
Committed: Thu Sep 10 19:11:12 2015 +0200

--
 .../rest/DefaultContentTypeHandlerManager.java   | 15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/struts/blob/4cd9a74c/plugins/rest/src/main/java/org/apache/struts2/rest/DefaultContentTypeHandlerManager.java
--
diff --git 
a/plugins/rest/src/main/java/org/apache/struts2/rest/DefaultContentTypeHandlerManager.java
 
b/plugins/rest/src/main/java/org/apache/struts2/rest/DefaultContentTypeHandlerManager.java
index 2e3201a..5f50bf9 100644
--- 
a/plugins/rest/src/main/java/org/apache/struts2/rest/DefaultContentTypeHandlerManager.java
+++ 
b/plugins/rest/src/main/java/org/apache/struts2/rest/DefaultContentTypeHandlerManager.java
@@ -126,8 +126,12 @@ public class DefaultContentTypeHandlerManager implements 
ContentTypeHandlerManag
  */
 public String handleResult(ActionConfig actionConfig, Object methodResult, 
Object target) throws IOException {
 String resultCode = readResultCode(methodResult);
+Integer statusCode = readStatusCode(methodResult);
 HttpServletRequest req = ServletActionContext.getRequest();
 HttpServletResponse res = ServletActionContext.getResponse();
+if(statusCode != null) {
+res.setStatus(statusCode);
+}
 
 ContentTypeHandler handler = getHandlerForResponse(req, res);
 if (handler != null) {
@@ -143,13 +147,22 @@ public class DefaultContentTypeHandlerManager implements 
ContentTypeHandlerManag
 res.setContentLength(data.length);
 res.setContentType(handler.getContentType());
 res.getOutputStream().write(data);
-res.getOutputStream().close();
+res.getOutputStream().flush();
 }
 }
 }
 return resultCode;
 }
 
+
+protected Integer readStatusCode(Object methodResult) {
+if (methodResult instanceof HttpHeaders) {
+return ((HttpHeaders) methodResult).getStatus();
+} else {
+return null;
+}
+}
+
 protected String readResultCode(Object methodResult) {
 if (methodResult == null) {
 return null;