1. 14 6月, 2012 1 次提交
  2. 13 6月, 2012 1 次提交
    • R
      Raise RestClientException for unknown status codes · ab4952a9
      Rossen Stoyanchev 提交于
      HttpStatus cannot be created with an unknown status code. If a server
      returns a status code that's not in the HttpStatus enum values, an
      IllegalArgumentException is raised. Rather than allowing it to
      propagate as such, this change ensures the actual exception raised is
      a RestClientException.
      
      Issue: SPR-9406
      ab4952a9
  3. 01 6月, 2012 2 次提交
    • S
      Include response headers in RestTemplate exceptions · b992c3d3
      Scott Andrews 提交于
      Default HTTP error exceptions thrown from RestTemplate now include
      response headers in addition to the response body. In particular, this
      enables inspection of the Content-Type header allowing manual
      deserialization of the response body without guessing as to the content
      type.
      
       - introduce HttpStatusCodeException#getResponseHeaders
       - add constructor with headers param for HttpStatusCodeException,
         HttpClientErrorException and HttpServerErrorException
       - preserve exsisting constructor signatures
       - mark HttpHeaders as Serializable
       - generate new serialVersionUID where needed
      
      Issue: SPR-7938
      b992c3d3
    • C
      Polish web.client exceptions and related classes · bca2357b
      Chris Beams 提交于
      The following style updates have been made in anticipation of
      substantive changes in subsequent commits:
      
       - organize imports
       - correct whitespace errors (leading spaces in code, tabs in Javadoc)
       - wrap Javadoc at 90 chars; make imperative ("Return" vs. "Returns")
       - use conventional constructor argument wrapping
      
      A serialVersionUID has also been added to RestClientException and its
      ResourceAccessException subclass for consistency with the rest of that
      same exception hierarchy.
      
      Issue: SPR-7938
      bca2357b
  4. 22 5月, 2012 1 次提交
    • A
      Add convenient WebAppInitializer base classes · f64c13ad
      Arjen Poutsma 提交于
      This commit introduces three abstract WebApplicationInitializers, to be
      used in the typical setup of a Spring-based web application.
      
       - AbstractContextLoaderInitializer provides an abstract base class for
         registering a ContextLoaderListener.
      
       - AbstractDispatcherServletInitializer provides an abstract base class
         for registering a DispatcherServlet, with an optional root context.
      
       - AbstractAnnotationConfigDispatcherServletInitializer provides an
         abstract base class for registering a DispatcherServlet and optional
         ContextLoaderListener based on annotated (e.g. @Configuration)
         classes.
      
      Issue: SPR-9300
      f64c13ad
  5. 18 5月, 2012 1 次提交
  6. 17 5月, 2012 1 次提交
    • C
      Fix property replacement bug in Log4jWebConfigurer · 2503b7eb
      Chris Beams 提交于
      Previously, if the resolution of a ${...} placeholder resulted in a
      valid URL for the location of a log4j properties/XML file, the URL
      would ultimately be malformed by an unnecessary call to to
      WebUtils#getRealPath.
      
      The implementation of Log4jWebConfigurer#initLogging now eagerly
      attempts SystemPropertyUtils#resolvePlaceholders before checking to see
      if the location is a valid URL, and bypassing the call to
      WebUtils#getRealPath if so.
      
      Issue: SPR-9417
      2503b7eb
  7. 16 5月, 2012 1 次提交
    • C
      Restore serializability of HttpStatusCodeException · 2ff43726
      Chris Beams 提交于
      SPR-7591 introduced a java.nio.charset.Charset field within
      HttpStatusCodeException. The former is non-serializable, thus by
      extension the latter also became non-serializable.
      
      Because the Charset field is only used for outputting the charset name
      in HttpStatusCodeException#getResponseBodyAsString, it is reasonable to
      store the value returned by Charset#name() instead of the actual Charset
      object itself.
      
      This commit refactors HttpStatusCodeException's responseCharset field to
      be of type String instead of Charset and adds tests to prove that
      HttpStatusCodeException objects are once again serializable as expected.
      
      Issue: SPR-9273, SPR-7591
      2ff43726
  8. 12 5月, 2012 1 次提交
  9. 11 5月, 2012 1 次提交
    • R
      Fix issue with resolving Errors controller argument · c499df23
      Rossen Stoyanchev 提交于
      The ErrorsMethodArgumentResolver expects the preceding @ModelAttribute
      in the controller method signature to be the last one added in the
      model -- an assumption that can break if a model attribute is added
      earlier (e.g. through a @ModelAttribute method) and more attributes
      are added as well. This fix ensures when an @ModelAttribute is resolved
      as a controller method argument it has the highest index in the model.
      
      Issue: SPR-9378
      c499df23
  10. 10 5月, 2012 2 次提交
    • R
      Pretty print option for Jackson converter and view · db289495
      Rossen Stoyanchev 提交于
      Jackson serialization supports pretty printing. Usually it's enabled
      by invoking ObjectMapper.configure(..), which is not convenient for
      apps with XML configuration. The Jackson HttpMessageConverter and View
      now both have a prettyPrint property.
      
      A second more serious issue is documented here:
      https://github.com/FasterXML/jackson-databind/issues/12
      
      The workaround discussed at the above link has been implemented.
      
      Issue: SPR-7201
      db289495
    • R
      Add Jackson 2 HttpMessageConverter and View · e63ca04f
      Rossen Stoyanchev 提交于
      Jackson 2 uses completely new package names and new maven artifact ids.
      This change adds Jackson 2 as an optional dependency and also provides
      MappingJackson2HttpMessageConverter and MappingJackson2JsonView for use
      with the new version.
      
      The MVC namespace and the MVC Java config detect and use
      MappingJackson2HttpMessageConverter if Jackson 2 is present.
      Otherwise if Jackson 1.x is present,
      then MappingJacksonHttpMessageConverter is used.
      
      Issue: SPR-9302
      e63ca04f
  11. 02 5月, 2012 1 次提交
  12. 27 4月, 2012 1 次提交
    • R
      Add ability to handle a timeout to DeferredResult · 7ee821d3
      Rossen Stoyanchev 提交于
      When a controller returns a DeferredResult, the underlying async
      request will eventually time out. Until now the default behavior was
      to send a 503 (SERVICE_UNAVAILABLE). However, this is not desirable
      in all cases. For example if waiting on an event, a timeout simply
      means there is no new information to send.
      
      To handle those cases a DeferredResult now accespts a timeout result
      Object in its constructor. If the timeout occurs before the
      DeferredResult is set, the timeout result provided to the constructor
      is used instead.
      
      Issue: SPR-8617
      7ee821d3
  13. 24 4月, 2012 1 次提交
    • R
      Polish Servlet async request processing · f37efb42
      Rossen Stoyanchev 提交于
      * Clarify semantics and behavior of AsyncWebRequest methods in most cases
      making a best effort and not raising an exception if async processing
      has completed for example due to a timeout. The startAsync() method is
      still protected with various checks and will raise ISE under a number
      of conditions.
      * Return 503 (service unavailable) when requests time out.
      * Logging improvements.
      
      Issue: SPR-8517
      f37efb42
  14. 19 4月, 2012 2 次提交
    • R
      Fix broken test · b51caae0
      Rossen Stoyanchev 提交于
      Issue: SPR-8517
      b51caae0
    • R
      Initial cut of Servlet 3.0 based async support · 3642b0f3
      Rossen Stoyanchev 提交于
      From a programming model perspective, @RequestMapping methods now
      support two new return value types:
      
      * java.util.concurrent.Callable - used by Spring MVC to obtain the
      return value asynchronously in a separate thread managed transparently
      by Spring MVC on behalf of the application.
      * org.springframework.web.context.request.async.DeferredResult - used
      by the application to produce the return value asynchronously in a
      separate thread of its own choosing.
      
      The high-level idea is that whatever value a controller normally
      returns, it can now provide it asynchronously, through a Callable or
      through a DeferredResult, with all remaining processing --
      @ResponseBody, view resolution, etc, working just the same but
      completed outside the main request thread.
      
      From an SPI perspective, there are several new types:
      
      * AsyncExecutionChain - the central class for managing async request
      processing through a sequence of Callable instances each representing
      work required to complete request processing asynchronously.
      * AsyncWebRequest - provides methods for starting, completing, and
      configuring async request processing.
      * StandardServletAsyncWebRequest - Servlet 3 based implementation.
      * AsyncExecutionChainRunnable - the Runnable used for async request
      execution.
      
      All spring-web and spring-webmvc Filter implementations have been
      updated to participate in async request execution.
      The open-session-in-view Filter and interceptors implementations in
      spring-orm will be updated in a separate pull request.
      
      Issue: SPR-8517
      3642b0f3
  15. 31 1月, 2012 2 次提交
    • C
      Mark remaining @Ignored tests with 'TODO SPR-8116' · ddf8eaf3
      Chris Beams 提交于
      Each of these tests began failing during the Gradle build porting
      process. None seem severe, many are likely due to classpath issues.
      
      In the case of TestNG support, this needs to be added to the Gradle
      build in order to execute these tests. See SPR-8116.txt
      ddf8eaf3
    • C
      Rename modules {org.springframework.*=>spring-*} · 02a4473c
      Chris Beams 提交于
      This renaming more intuitively expresses the relationship between
      subprojects and the JAR artifacts they produce.
      
      Tracking history across these renames is possible, but it requires
      use of the --follow flag to `git log`, for example
      
          $ git log spring-aop/src/main/java/org/springframework/aop/Advisor.java
      
      will show history up until the renaming event, where
      
          $ git log --follow spring-aop/src/main/java/org/springframework/aop/Advisor.java
      
      will show history for all changes to the file, before and after the
      renaming.
      
      See http://chrisbeams.com/git-diff-across-renamed-directories
      02a4473c