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. 28 5月, 2012 2 次提交
  5. 26 5月, 2012 1 次提交
    • C
      Introduce ConfigurableWebEnvironment · 2a2b6eef
      Chris Beams 提交于
      Changes introduced in Spring 3.1 for Environment support inadvertently
      established a cyclic dependency between the
      org.springframework.web.context and
      org.springframework.web.context.support packages, specifically through
      web.context.ContextLoader's invocation of
      web.context.support.WebApplicationContextUtils#initServletPropertySources.
      
      This commit introduces ConfigurableWebEnvironment to break this cyclic
      dependency. All web.context.ConfigurableWebApplicationContext types now
      return web.context.ConfigurableWebEnvironment from their #getEnvironment
      methods; web.context.support.StandardServletEnvironment now implements
      ConfigurableWebEnvironment and makes the call to
      web.context.support.WebApplicationContextUtils#initServletPropertySources
      within its implementation of #initPropertySources. This means that
      web.context.ContextLoader now invokes
      web.context.ConfigurableWebEnvironment#initPropertySources instead of
      web.context.support.WebApplicationContextUtils#initServletPropertySources
      and thus the cycle is broken.
      
      Issue: SPR-9439
      2a2b6eef
  6. 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
  7. 19 5月, 2012 1 次提交
    • R
      Fix issue with resolution of WebDataBinder argument · 03d6350e
      Rossen Stoyanchev 提交于
      There is usually not need to put annotations on a WebDataBinder
      argument in an `@InitBinder` method. However, the presence of any
      annotation prevented the successful resolution of the argument.
      This fix addresses the issue.
      
      Issue: SPR-8946
      03d6350e
  8. 18 5月, 2012 3 次提交
    • R
      Add required flag to @RequestBody · 77ae1014
      Rossen Stoyanchev 提交于
      If true and there is no body => HttpMessageNotReadableException
      If false and there is no body, the argument resolves to null.
      
      Issue: SPR-9239
      77ae1014
    • R
      Decode path vars when url decoding is turned off · 57307a0b
      Rossen Stoyanchev 提交于
      When URL decoding is turned off in AbstractHandlerMapping, the
      extracted path variables are also not encoded. Turning off URL decoding
      may be necessary for request mapping to work correctly when the path
      may contain the (encoded) special character '/'. At the same time there
      is no good reason not to leave path variables encoded. This change
      ensures path variables are encoded when URL decoding is turned off.
      
      Issue: SPR-9098
      57307a0b
    • S
      Polish recent changes to Log4jWebConfigurer · 59e3223c
      Sam Brannen 提交于
      Reordered inline comments so that they now apply to current
      state of the code.
      
      Added logger entry in testlog4j.properties to avoid console
      warning.
      
      Issue: SPR-9417
      59e3223c
  9. 17 5月, 2012 2 次提交
    • P
      Fix compiler warnings · 13239a0c
      Philippe Marschall 提交于
      This patch fixes several compiler warnings that do not point to code
      problems. Two kinds of warnings are fixed. First in a lot of cases
      @SuppressWarnings("unchecked") is used although there are no unchecked
      casts happening. This seems to be a leftover from when the code base
      was on Java 1.4, now that the code base was moved to Java 1.5 these are
      no longer necessary. Secondly there some places where the raw types of
      List and Class are used where there wildcard types (List<?> and
      Class<?>) would work just as well without causing any raw type warnings.
      
      These changes are beneficial particularly when working in Eclipse or
      other IDEs because it reduces 'noise', helping to isolate actual
      potential problems in the code.
      
      The following changes have been made:
      
       - remove @SuppressWarnings where no longer needed
      
       - use wildcard types instead of raw types where possible
      13239a0c
    • 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
  10. 16 5月, 2012 2 次提交
    • C
      Fix broken javadoc link to ROME tools project · 19aceebb
      Chris Beams 提交于
      Issue: SPR-9379
      19aceebb
    • 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
  11. 15 5月, 2012 2 次提交
  12. 12 5月, 2012 3 次提交
  13. 11 5月, 2012 2 次提交
    • R
      Translate EOF to HttpMessageNotReadableException · 816c1f47
      Rossen Stoyanchev 提交于
      The MappingJacksonHttpMessageConverter now catches all IOException
      types raised while reading JSON and translates them into
      HttpMessageNotReadableException.
      
      Issue: SPR-9238
      816c1f47
    • 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
  14. 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
  15. 05 5月, 2012 1 次提交
    • R
      HanderInterceptor and OSIV async request changes · e7506b50
      Rossen Stoyanchev 提交于
      This change updates Open-Session-in-View filters and interceptors for
      use in async requests mainly ensuring the open Hibernate session is
      unbound from the main request processing thread and bound to the to
      async thread.
      
      Issue: SPR-8517
      e7506b50
  16. 02 5月, 2012 2 次提交
  17. 30 4月, 2012 1 次提交
    • S
      Fix javadoc warnings · effb7625
      Stevo Slavic 提交于
      Before this change there were numerous javadoc warnings being reported
      while building Spring framework API.
      
      This commit resolves most of the javadoc warnings, reducing the total
      number from 265 to 103.
      
      Issue: SPR-9113
      effb7625
  18. 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
  19. 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
  20. 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
  21. 07 4月, 2012 1 次提交
    • R
      Use the type of the actual return value in @mvc · cfe2af76
      Rossen Stoyanchev 提交于
      The new @mvc support classes select a HandlerMethodArgumentResolver
      and a HandlerMethodReturnValueHandler statically, i.e. based on
      the signature of the method, which means that a controller method
      can't declare a more general return type like Object but actually
      return a more specific one, e.g.  String vs RedirectView, and
      expect the right handler to be used.
      
      The fix ensures that a HandlerMethodReturnValueHandler is selected
      based on the actual return value type, which is something that was
      supported with the old @mvc support classes. One consequence
      of the change is the selected HandlerMethodReturnValueHandler can
      no longer be cached but that matches the behavior of the old
      @mvc support classes.
      
      Issues: SPR-9218
      cfe2af76
  22. 03 4月, 2012 1 次提交
  23. 03 3月, 2012 1 次提交
    • S
      Fix MultipartResolver javadoc implementation refs · 104f13e4
      Stevo Slavic 提交于
      Before this fix MultipartResolver javadoc mentioned that there is only
      one concrete implementation included in Spring. This was true as of
      Spring 2.5 but Spring 3.1 added another one, Servlet 3.0 Part API based
      implementation.
      
      This fix changes MultipartResolver javadoc so that the other one,
      StandardServletMultipartResolver implementation, gets also listed.
      Changed javadoc mentions also as of which version does Spring bundle
      two MultipartResolver implementations.
      
      Issue: SPR-5984
      104f13e4
  24. 31 1月, 2012 3 次提交
    • 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
      Remove bundlor support · 6235a341
      Chris Beams 提交于
      6235a341
    • 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