Commit Graph

1177 Commits

Author SHA1 Message Date
Rossen Stoyanchev c499df2315 Fix issue with resolving Errors controller argument
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
2012-05-10 16:01:14 -04:00
Rossen Stoyanchev e63ca04fdb Add Jackson 2 HttpMessageConverter and View
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
2012-05-09 13:07:25 -04:00
Rossen Stoyanchev a33fe6fa0a Fix issue with encoded params in UriComponentsBuilder
The fromUri method of UriComponentsBuilder used uri.getXxx() methods,
which decode the URI parts causing URI parsing issues. The same method
now uses uri.getRawXxx().

Issue: SPR-9317
2012-05-01 16:10:38 -04:00
Rossen Stoyanchev 3642b0f365 Initial cut of Servlet 3.0 based async support
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
2012-04-18 16:36:09 -04:00
Chris Beams 57b89e0388 Fix typo in ApplicationContext reference doc 2012-04-16 13:36:12 +03:00
Chris Beams 0ab9e9a0c6 Upgrade AspectJ from 1.6.8 to 1.6.12
- Spring remains compatible against AJ version 1.6.8, but is now
   compiling and testing against 1.6.12

 - Encountered what appears to be an AJ bug introduced in 1.6.10: an
   assertion in org.aspectj.weaver.UnresolvedType causes a false
   negative failure when encountering org.springframework.io.Resource
   arrays, e.g. "[org.springframework.io.Resource@xxx". This problem
   has been reported to the AJ team and in the meantime, the recommended
   workaround is to disable assertions either completely, or at least
   selectively with

       -disableassertions:org.aspectj.weaver.UnresolvedType

Issue: SPR-7989, SPR-9272
2012-04-14 19:05:20 +03:00
Chris Beams f6003b5102 Fix typo in reference documentation
Issue: SPR-9321
2012-04-13 20:41:37 +03:00
Rossen Stoyanchev cfe2af7690 Use the type of the actual return value in @MVC
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
2012-04-06 16:50:22 -04:00
Rossen Stoyanchev ca8b98e947 Fix issue with parsing media types
Invalid Content-Type or Accept header values previously resulted in the
IllegalArgumentException getting propagated. After this change such
errors are detected and generally treated as a "no match", which
may for example result in a 406 in the case of the Accept header.

Issue: SPR-9148
2012-04-02 17:36:23 -04:00
Stevo Slavic 924c869b8a Remove note on singleton-scoped proxy raising BCE
Before this change bean scopes chapter in Spring reference documentation
had a note which mentioned that creating a scoped proxy for singleton-
or prototype-scoped beans will throw BeanCreationException.

This is no longer the case and this change removes the mentioned note.

Issue: SPR-7940
2012-03-01 12:29:40 +01:00
Phani Kandula 00d9c3f5e8 Fix typo in spring:eval taglib reference doc
- Replace 'javascriptEncoding' with 'javaScriptEscape'

Issue: SPR-9188
2012-03-01 12:12:52 +01:00
Phani Kandula 6c602d7bbc Fix typo in ApplicationContext reference doc
- Add missing '=' sign in sample code for section 4.2.3

Issue: SPR-8856
2012-03-01 12:12:45 +01:00
Chris Beams 37d547c506 Sync with 3.1.x
* 3.1.x:
  Warn re Environment construction and instance vars
  Disallow empty @PropertySource(value = {})
  Fix @PropertySource bug with multiple values
  final preparations for 3.1.1 release
  added "receive-timeout" attribute to "jms:listener-container" element
2012-02-20 14:19:04 +01:00
Chris Beams 3e81482760 Sync with 3.1.x
* 3.1.x:
  Demonstrate use of @Configuration as meta-annotation
  Prune dead code from JmsTransactionManager#doBegin
  Apply @Configuration BeanNameGenerator consistently
  Improve @Configuration bean name discovery
  Fix infinite recursion bug in nested @Configuration
  Polish static imports
  Minor fix in ServletResponseMethodArgumentResolver
  extracted ResourceUtils.useCachesIfNecessary(URLConnection) method (SP
  prepared for 3.1.1 release
  CustomSQLExceptionTranslatorRegistry/Registrar etc
  revised CustomSQLExceptionTranslatorRegistry/Registrar method naming
  use custom InputStream traversal instead of a full byte array (SPR-911
  PathMatchingResourcePatternResolver preserves caching for JNLP jar con
  Resource "contentLength()" implementations work with OSGi bundle resou
  fixed MethodInvokingJobDetailFactoryBean for compatibility with Quartz
  fixed MethodInvokingJobDetailFactoryBean for compatibility with Quartz
2012-02-16 13:00:28 +01:00
Chris Beams ee36c80ca9 Sync with 3.1.x
* 3.1.x: (61 commits)
  Compensate for changes in JDK 7 Introspector
  Avoid 'type mismatch' errors in ExtendedBeanInfo
  Polish ExtendedBeanInfo and tests
  Infer AnnotationAttributes method return types
  Minor fix in MVC reference doc chapter
  Hibernate 4.1 etc
  TypeDescriptor equals implementation accepts annotations in any order
  "setBasenames" uses varargs now (for programmatic setup; SPR-9106)
  @ActiveProfiles mechanism works with @ImportResource as well (SPR-8992
  polishing
  clarified Resource's "getFilename" method to consistently return null
  substituteNamedParameters detects and unwraps SqlParameterValue object
  Replace spaces with tabs
  Consider security in ClassUtils#getMostSpecificMethod
  Adding null check for username being null.
  Improvements for registering custom SQL exception translators in app c
  SPR-7680 Adding QueryTimeoutException to the DataAccessException hiera
  Minor polish in WebMvcConfigurationSupport
  Detect overridden boolean getters in ExtendedBeanInfo
  Polish ExtendedBeanInfoTests
  ...
2012-02-13 15:17:30 +01:00
Chris Beams 0ae973f995 Merge branch '3.1.x'
Conflicts:
	spring-webmvc/src/main/java/org/springframework/web/servlet/support/DefaultFlashMapManager.java
	spring-webmvc/src/test/java/org/springframework/web/servlet/support/DefaultFlashMapManagerTests.java
2012-02-01 11:39:48 +01:00
Chris Beams 398cf997b3 Merge branch '3.1.x'
This is the first merge from 3.1.x => master after the Gradle build
system migration. Notice how files changed under the 3.1.x directory
structure (org.springframework.*) merge seamlessly into the new
directory structure (spring-*).

Certain files had changed under 3.1.x that have since been deleted with
the Gradle build migration, e.g. all pom.xml files had <license>
sections added. These files showed up as a conflict during the merge,
but the resolution is to simply re-remove them and commit as they are
no longer relevant under 3.2.x / master.

Also noteworthy is the .gitignore file. It has been updated under 3.1.x
to ignore files and directories specific to the new Gradle-based
structure. However, this causes conflicts when trying to merge against
master, given that master should *not* ignore this directories. The
resolution in this situation is to simply force the 'master' version of
the file, i.e. when prompted for merge resolution:

    anakata:~/Work/spring-framework/spring-framework[master|MERGING]
    $ git status -sb
    ## master...springsource/master [ahead 24]
    UU .gitignore

    anakata:~/Work/spring-framework/spring-framework[master|MERGING]
    $ git checkout master .gitignore

    anakata:~/Work/spring-framework/spring-framework[master|MERGING]
    $ git commit

It is helpful in situations like this one to enable git's "rerere"
feature beforehand, which records and remembers resolution strategies,
avoiding the need to repeat them in future merges:

    $ git config --global rerere.enabled 1

See:
    http://progit.org/2010/03/08/rerere.html
    http://gitfu.wordpress.com/2008/04/20/git-rerere-rereremember-what-you-did-last-time

Conflicts:
    .gitignore
    .springframework.*/pom.xml
2012-01-31 16:03:24 +01:00
Chris Beams 366f0d7892 Generate -sources and -javadoc jars
Each spring-* subproject now has sourcesJar and javadocJar tasks

 - Ignore subproject overview.html files for now (not all have one)
 - Ensure @author attribution occurs
 - Javadoc 'header' is project description

spring-asm is a special case

 - source jar is created, but empty (to comply with entry rules for
   Maven Central)

 - add package-info.java explaining the nature of spring-asm
   this is nice, because it shows up in the public API docs now.

 - add SpringAsmInfo in the org.springframework.asm package as a
   placeholder allowing the generation of javadocs (see link to bug)

 - add explicit 'repackageAsm' Gradle task allowing for easy testing
   and merging of jar containing bundlor manifest as well as jar
   containing repackaged ASM classes.
2012-01-31 14:32:16 +01:00
Chris Beams 2bab8f3c0b Generate -docs, -schema and -dist zips
- Add 'api' gradle task to generate project-wide API Javadoc

   results in <root>/build/api

 - Add docsZip task including api and reference documentation

   suitable for publication to
   http://static.springframework.org/docs/spring-framework

 - Add schemaZip task including all spring-* XSD files

   suitable for publication to http://static.springframework.org/schema

 - Add distZip task to include all libs, docs and schema

   - filter src/dist/*.txt for ${copyright} and ${version}
   - copy legal (notice, license) dynamically into individual jar files
   - copy legal and readme files into root of distribution zip

 - Refactor location of 'wrapper' task

Each of the zip tasks (docsZip, schemaZip, distZip) have been added to
the 'archives' configuration, meaning that (a) they will be built
automatically with `gradle build` and (b) will be published
automatically to artifactory when using the Artifactory Gradle plugin
and/or Artifactory Bamboo integration.
2012-01-31 14:32:16 +01:00
Chris Beams 2ca6d0b2be Centralize license, notice, etc in src/dist
Prior to this change, license.txt and notice.txt files were duplicated
across every subproject in their respective src/main/resources/META-INF
directories.

This commit centralizes these files under the root project at src/dist,
along with the changelog and readme files. The definition of the 'jar'
task has been been extended to include the license and notice files in
module jars as they are created.

The directory is named src/dist because these files are all related to
distribution - the readme is different than the one you see at the root
of the source tree - the intended audience is for users who download
the spring-framework distribution zip. A task to create that
distribution zip will be added in subsequent commits.
2012-01-31 14:32:15 +01:00
Chris Beams 86b5066a96 Fix minor problems and polish reference docs
Problems

 - Eliminate &mdash; in favor of &#151;

   &mdash; was causing 'no such entity' errors during docbook
   processing; &#151; produces the equivalent output.

 - Fix column issues in appendices

   column counts were set to 3, when they are in fact 4. This passed
   under DocBook 4 and Spring Build for unknown reasons, but caused a
   hard stop under DocBook 5 and the docbook-reference-plugin.

 - Add jdbc callout section in docbook 5-friendly style

   use <co/> tags as advertised in DocBook documentation.

 - Set correct widths for PDF ref doc images

   images were rendering larger than the PDF page; just set all to
   width=400 and everything looks good.

Polish

 - Update reference doc copyright to 2012

 - Remove "work-in-progress" language from ref docs

 - Update maven URLs to repo.springsource.org

 - Update javadoc urls from 3.0.x/javadoc-api => current/api

 - Replace hardcoded "3.1" with ${version} in ref doc
2012-01-31 14:32:15 +01:00
Chris Beams 7a3aa70565 Remove <emphasis> to work around DocBook bug
It was determined (through painful trial and error) that after the
upgrade to DocBook 5 and the gradle-docbook-reference plugin, that
<emphasis> elements embedded within <programlisting> elements causes
NullPointerExceptions during processing.

This change eliminates these <emphasis> elements to work around the
problem. This means a slight degradation in presentation for the
affected areas of the reference documentation. After some research,
it is not clear what other workarounds may be possible that leave
the text actually emphasized.
2012-01-31 14:32:15 +01:00
Chris Beams 3641337186 Upgrade reference docs to DocBook 5
For compatibility with Gradle docbook-reference-plugin, which cannot
handle DocBook 4.
2012-01-31 14:32:15 +01:00
Chris Beams 62e94461f4 Move reference docs => src/reference
This change eliminates the spring-framework-reference subproject, moving
these sources into the root project's own src directory.

This makes sense because the reference docs span all submodules, and
also because api Javadoc is created at the root project level as well.
This means that both api and reference documentation output will now
reside in the root project's 'build' directory. This is more consistent
and easy to discover.
2012-01-31 14:32:14 +01:00
Chris Beams 0a07a0ed92 Move integration tests => src/test
This commit eliminates the 'integration-tests' subproject in favor of
managing these sources under the root project's own 'src' directory.

This helps to avoid special-case handling for integration-tests in the
Gradle build, e.g. avoiding publication of jars to Artifactory /
Maven Central.

It is also semantically more correct. This is not a Spring Framework
subproject so much as it is a collection of integration tests that
span functionality across many subprojects. In this way, it makes
sense to place them directly under the root project.

Issue: SPR-8116
2012-01-31 14:32:14 +01:00
Chris Beams 9fce69849a Move misplaced integration test to proper location 2011-08-15 21:44:18 +00:00
Chris Beams f480333d31 Merge 3.1.0 development branch into trunk
Branch in question is 'env' branch from git://git.springsource.org/sandbox/cbeams.git; merged into
git-svn repository with:

    git merge -s recursive -Xtheirs --no-commit env

No merge conflicts, but did need to

    git rm spring-build

prior to committing.

With this change, Spring 3.1.0 development is now happening on SVN
trunk. Further commits to the 3.0.x line will happen in an as-yet
uncreated SVN branch.  3.1.0 snapshots will be available
per the usual nightly CI build from trunk.
2010-10-25 19:48:20 +00:00