[jboss-jira] [JBoss JIRA] Resolved: (JBPORTAL-2368) Setting the ResourceResponse.HTTP_STATUS_CODE property does not modify the actual server response status code

Thomas Heute (JIRA) jira-events at lists.jboss.org
Tue Apr 14 09:20:30 EDT 2009


     [ https://jira.jboss.org/jira/browse/JBPORTAL-2368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Heute resolved JBPORTAL-2368.
------------------------------------

    Fix Version/s: 2.7.3 Final
       Resolution: Done


Indeed.

Applied on the 2.7 Branch, thanks !

> Setting the ResourceResponse.HTTP_STATUS_CODE property does not modify the actual server response status code
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: JBPORTAL-2368
>                 URL: https://jira.jboss.org/jira/browse/JBPORTAL-2368
>             Project: JBoss Portal
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Portal Core
>    Affects Versions: 2.7.2 Final
>         Environment: Not appropriate for this issue
>            Reporter: Philip Kedy
>            Priority: Minor
>             Fix For: 2.7.3 Final
>
>
> If you set the ResourceResponse.HTTP_STATUS_CODE property of the ResourceResponse object, the status remains unchanged.  Without this capability ajax calls return 200 Success even if you set an error.
> This is an additional tweak related to bug #2242
> In the class org.jboss.portal.core.controller.handler.HTTPResponse I made the following tweak to both HTTPResponse.sendResponse methods.  This assumes the property value is a valid integer string.
> Before change:
>             if (properties != null)
>             {
>             	for (String key: properties.keySet())
>             	{
>             		if (properties.getValue(key) != null)
>             		{
>                 		resp.addHeader(key, properties.getValue(key));
>             		}
>             	}
>             }
> After change:
>             if (properties != null)
>             {
>             	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));
>             			}
>             		}
>             	}
>             }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list