Author: thomas.heute(a)jboss.com
Date: 2009-04-14 09:19:19 -0400 (Tue, 14 Apr 2009)
New Revision: 13207
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/handler/HTTPResponse.java
Log:
JBPORTAL-2368: Setting the ResourceResponse.HTTP_STATUS_CODE property does not modify the
actual server response status code
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/handler/HTTPResponse.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/handler/HTTPResponse.java 2009-04-13
19:26:04 UTC (rev 13206)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/handler/HTTPResponse.java 2009-04-14
13:19:19 UTC (rev 13207)
@@ -26,6 +26,7 @@
import org.jboss.portal.common.util.MultiValuedPropertyMap;
import org.jboss.portal.server.ServerInvocationContext;
+import javax.portlet.ResourceResponse;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
@@ -77,13 +78,20 @@
if (properties != null)
{
- for (String key: properties.keySet())
- {
- if (properties.getValue(key) != null)
- {
- resp.addHeader(key, properties.getValue(key));
- }
- }
+ for (String key : properties.keySet())
+ {
+ if (properties.getValue(key) != null)
+ {
+ if (key.equals(ResourceResponse.HTTP_STATUS_CODE))
+ {
+ resp.setStatus(Integer.parseInt(properties.getValue(key)));
+ }
+ else
+ {
+ resp.addHeader(key, properties.getValue(key));
+ }
+ }
+ }
}
//