[
https://issues.apache.org/jira/browse/HTTPCORE-39?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470988
]
Roland Weber commented on HTTPCORE-39:
--------------------------------------
Hi Oleg,
it looks better on the first and second glance. The problem is that the locale
needs to be available at the time the response object is created. In
HttpService and it's NIO counterparts, the response is initially created very
early, to be updated in some cases and replaced with a newly created response
in others. If request handlers are invoked and there is no error, the response
is not replaced and the locale would have been determined before the request
handling.
If we add HttpResponse.setLocale() to allow for request handlers that determine
the locale dynamically, it could work. But do you like that better? And
HttpService et al would need to be revised so they either don't replace the
response object, or somehow get the locale set there and push it into the
factory when creating the replacement. Not replacing is the easier version.
Personally, I like the idea of passing the context around to wherever custom
code might need it. It's a convenient way for application developers to deliver
their custom data to the various plug-in points in the framework.
cheers,
Roland
> refactor HttpStatus
> -------------------
>
> Key: HTTPCORE-39
> URL: https://issues.apache.org/jira/browse/HTTPCORE-39
> Project: HttpComponents Core
> Issue Type: Improvement
> Components: HttpCore
> Affects Versions: 4.0-alpha3
> Reporter: Roland Weber
> Assigned To: Roland Weber
> Priority: Minor
> Fix For: 4.0-alpha4
>
> Attachments: 2k7-02-03-HttpStatus.txt, 2k7-02-04-status-followup.txt,
> 2k7-02-06-impl-catalog.txt
>
>
> The HttpStatus class not only represents a status code with associated
> message, it also has static factory methods for creating objects with
> hard-coded english status messages. Suggested improvements:
> - define HttpStatusFactory in the API
> - move the factory method stuff to impl, for example EnglishHttpStatusFactory
> - reduce HttpStatus class to representation only, final and serializable
> patch to follow when I find the time
> cheers,
> Roland
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]