Commit Graph

664 Commits

Author SHA1 Message Date
Rossen Stoyanchev e5eceafa3f SPR-7278 extension hook to extend the @ExceptionHandler methods for a controller 2011-06-17 13:14:34 +00:00
Rossen Stoyanchev 96b0752ddb SPR-7812 RequestCondition refactoring with the possibility for custom request conditions in mind. 2011-06-17 09:39:49 +00:00
Rossen Stoyanchev 23f31d453f SPR-8448 Remove URI template vars from the model before appending to query string in RedirectView 2011-06-15 21:07:37 +00:00
Rossen Stoyanchev ab033086f9 SPR-8454 Introduce Registration style objects, rename several Spring MVC *Configurer helpers to *Registry, add more tests 2011-06-15 08:06:42 +00:00
Juergen Hoeller cb1ddb334b consistent dependency on Hibernate Validator 4.1.0.GA 2011-06-14 21:39:17 +00:00
Rossen Stoyanchev fa0b683161 Extract base class from RequestMappingHandlerMapping, one that allows for discovering request mappings from something other than annotations 2011-06-14 09:20:07 +00:00
Juergen Hoeller 6c3cc786d0 added further conversion tests (triggered by 3.0.6 backports) 2011-06-13 23:43:46 +00:00
Rossen Stoyanchev 883ac319bc SPR-8430 Rename WebMvcConfiguration to DelegatingWebMvcConfiguration, make it public and make delegation methods final 2011-06-13 12:20:25 +00:00
Chris Beams 9b45d50b9b Add missing isDebugEnabled guard in FrameworkServlet
Issue: SPR-8085
2011-06-13 08:31:15 +00:00
Chris Beams 2d68b726b5 Add syntax highlighting to Javadoc where necessary
Issue: SPR-8426
2011-06-12 06:56:17 +00:00
Rossen Stoyanchev fdeeeac5d0 SPR-8430 2011-06-09 15:12:02 +00:00
Rossen Stoyanchev 00d57907a3 Introduce base class for WebMvcConfiguration 2011-06-09 11:17:45 +00:00
Juergen Hoeller c60511bf04 shortened build properties "org.junit.version" to "junit.version" and "org.testng.version" to "testng.version"; reverted SLF4J version back to 1.5.3 (for Hibernate 3.3.1 compatibility) 2011-06-09 09:58:15 +00:00
David Syer 32ebf18429 SPR-5937: add param map to freemarker url macro 2011-06-05 21:02:02 +00:00
David Syer c2e62f098a Add ignorable log file to .gitignore 2011-06-05 21:01:37 +00:00
Rossen Stoyanchev f1ad53d570 SPR-6709 Update changelog and add one test 2011-06-03 09:38:22 +00:00
Rossen Stoyanchev 9d2ee7061c SPR-6709 Handle RequestBodyNotValidException and update reference docs 2011-06-02 18:27:50 +00:00
Rossen Stoyanchev 18f5d90235 SPR-6709 Support @Valid with @RequestBody method arguments 2011-06-02 17:21:44 +00:00
Chris Beams cee9da36eb Mention code alternatives in context and mvc XSDs 2011-06-02 14:45:00 +00:00
Rossen Stoyanchev ce78a519f6 SPR-8059 fix issue with != param condition 2011-06-02 12:29:26 +00:00
Chris Beams 2b4328023e Improve ApplicationContextInitializer sorting
ContextLoader and FrameworkServlet now use
AnnotationAwareOrderComparator to support @Order usage; previously
supported only implementation of the Ordered interface.
2011-05-30 12:55:33 +00:00
Chris Beams 2eea63eec5 Introduce Framework/DispatcherServlet constructors
Constructors have been added to both FrameworkServlet and
DispatcherServlet to support instance-based programmatic registration
of Servlets within ServletContainerInitializer implementations in
Servlet 3.0+ environments, and more particularly when using Spring 3.1's
WebApplicationInitializer SPI.

This change also renames the method added to FrameworkServlet in
SPR-8185 from #initializeWebApplicationContext to #applyInitializers.
The reason being that a method named #initWebApplicationContext was
already present and the names overlapped confusingly.

Issue: SPR-7672, SPR-8185
2011-05-30 12:54:48 +00:00
Chris Beams c4d98278e9 Fix DispatcherServlet warnings 2011-05-30 12:54:24 +00:00
Arjen Poutsma 37d955b35b Added tests for @RequestMaping produces and consumes 2011-05-25 09:21:44 +00:00
Rossen Stoyanchev c5833b192e SPR-7353 Use canWrite to narrow down list of producible types 2011-05-24 17:22:22 +00:00
Chris Beams c4363673dc Delegate parent environment to child app contexts
Calls to AbstractApplicationContext#setParent delegate the parent
context environment to the child.

This ensures that any property sources added to the parent are available
to the child as well as ensuring that any profiles activated are
activated everywhere.

Child contexts may still choose to replace their environment (through an
ApplicationContextInitializer, for example).  In any case, however, in
the root/child web application context relationship established by
ContextLoader + DispatcherServlet, the child is guaranteed to have
already been given the parent environment by the time it is delegated
to any ACIs.

See AbstractApplicationContext#setParent for implementation

See FrameworkServlet#createWebApplicationContext for order in which
setParent then initializeWebApplicationContext are called.

Issue: SPR-8185
2011-05-23 10:04:00 +00:00
Chris Beams 56720fc42c Support "contextInitializerClasses" init-param
FrameworkServlet now has support equivalent to ContextLoader and its
"contextInitializerClasses" context-param introduced in 3.1 M1.

This allows users to specify ApplicationContextInitializers at the root
(ContextLoader) level and/or at the DispatcherServlet level.

Issue: SPR-8366
2011-05-23 10:02:18 +00:00
Chris Beams 3c6254df90 Polish FrameworkServlet Javadoc; fix warnings 2011-05-23 10:01:49 +00:00
Rossen Stoyanchev 5fa7f24794 SPR-7353 Respect 'produces' condition in ContentNegotiatingViewResolver, improve selection of more specific media type in a pair 2011-05-20 17:02:20 +00:00
Chris Beams f893b62a9b Rename {DefaultWeb=>StandardServlet}Environment
Issue: SPR-8348
2011-05-20 03:55:56 +00:00
Rossen Stoyanchev 0bf92782ea SPR-8352 Init and apply MappedInterceptors from AbstractHandlerMapping 2011-05-19 16:45:25 +00:00
Rossen Stoyanchev 5ac2e4418f SPR-8350 ContentNegotiatingViewResolver initialization for nested ViewResolvers 2011-05-19 13:07:15 +00:00
Arjen Poutsma 1eaca65720 @RequestMapping.consumes() and produces() now default to an empty array, instead of */* 2011-05-18 11:34:47 +00:00
Rossen Stoyanchev af1dfd3577 Use request attribute to check producible media types when writing to the response body 2011-05-17 13:02:48 +00:00
Arjen Poutsma 1bbdb0d2ff minor fix. 2011-05-17 12:22:21 +00:00
Arjen Poutsma b0a4be7cd1 Only respect RequestMappingInfos that have a pattern match in handleNoMatch 2011-05-17 10:07:36 +00:00
Arjen Poutsma ad2e0d4587 SPR-7353 - @ResponseBody and returned HttpEntity now respect @RequestMapping.produces() 2011-05-17 09:45:57 +00:00
Rossen Stoyanchev 57c757afc5 SPR-2692 Update mvc chapter with URI template support in redirect: view names 2011-05-16 13:24:42 +00:00
Rossen Stoyanchev 1784df8d3e SPR-6996 Add mvc:interceptor bean references 2011-05-13 18:06:55 +00:00
Rossen Stoyanchev 5c0e22e7a8 SPR-8289 Ensure BeanNameUrlHandlerMapping and default HandlerAdapters are never 'turned off' through the MVC namespaces 2011-05-13 15:46:37 +00:00
Arjen Poutsma bb2cc8457f SPR-7353 - Added equivalent of JAX-RS @Produces to Spring MVC 2011-05-13 09:43:45 +00:00
Rossen Stoyanchev b46598965e Add method to allow further validation of request mapping infos at startup + other minor javadoc updates. 2011-05-12 15:03:36 +00:00
Rossen Stoyanchev 726e920857 Rename EnableMvcConfiguration->EnableWebMvc, refine method names in WebMvcConfigurer, fix issue with MappedInterceptors 2011-05-11 18:02:07 +00:00
Arjen Poutsma 9b0c66dc6c Make HTTP methods a RequestCondition 2011-05-11 10:38:30 +00:00
Arjen Poutsma 71aae405d5 SPR-7354 - Added equivalent of JAX-RS @Consumes to Spring MVC 2011-05-10 09:23:00 +00:00
Rossen Stoyanchev 8d0ab1d2e5 Refine HandlerMethod registration to allow detection by handler instance as well as by bean name 2011-05-08 19:31:29 +00:00
Chris Beams b7f4f2b546 Expose return-value-handlers in mvc namespace
Mirroring the MvcConfigurer#addCustomReturnValueHandlers callback which
allows for providing a list of HandlerMethodReturnValueHandler types
2011-05-06 19:13:44 +00:00
Chris Beams 1efb82d7cb Rename RequestMapping types for concision
Remove 'Method' from RequestMappingHandlerMethodMapping and
RequestMappingHandlerMethodAdapter
2011-05-06 19:13:05 +00:00
Chris Beams 2092a31f9d Rename DataBinderFactory subtypes for concision 2011-05-06 19:12:14 +00:00
Chris Beams 446dfdbff2 Introduce @EnableMvcConfiguration 2011-05-06 19:11:19 +00:00
Chris Beams 111fb71fe1 Remove "Feature" support introduced in 3.1 M1
Feature-related support such as @Feature, @FeatureConfiguration,
and FeatureSpecification types will be replaced by framework-provided
@Configuration classes and convenience annotations such as
@ComponentScan (already exists), @EnableAsync, @EnableScheduling,
@EnableTransactionManagement and others.

Issue: SPR-8012,SPR-8034,SPR-8039,SPR-8188,SPR-8206,SPR-8223,
SPR-8225,SPR-8226,SPR-8227
2011-05-06 19:03:52 +00:00
Rossen Stoyanchev c91ab1ad6e Resolve custom args after annotated args, set PATH_WITHIN_HANDLER_MAPPING attribute, and rename resolver for @ExceptionHandler methods 2011-05-03 15:39:13 +00:00
Rossen Stoyanchev 50117dce40 SPR-6909 Include URI template vars in data binding 2011-04-26 11:54:54 +00:00
Rossen Stoyanchev ed9d9a402b SPR-7543 Add @PathVariables to the model 2011-04-21 15:18:45 +00:00
Rossen Stoyanchev 945cf43e2d Remove consumes from @RequestMapping 2011-04-21 14:54:55 +00:00
Rossen Stoyanchev acb9433e5c SPR-8247 review changes 2011-04-21 11:40:24 +00:00
Rossen Stoyanchev d14c7f2d09 SPR-8247 2011-04-20 21:41:17 +00:00
Rossen Stoyanchev 57d327d1ff SPR-8255 2011-04-20 08:43:57 +00:00
Rossen Stoyanchev 9c65973b33 SPR-8214 review unit tests 2011-04-15 18:42:58 +00:00
Rossen Stoyanchev 83ce399c47 SPR-8248 2011-04-15 06:42:18 +00:00
Rossen Stoyanchev aa065e8310 SPR-8214 Javadoc and polish 2011-04-13 23:15:19 +00:00
Rossen Stoyanchev 6e03b4dd64 SWF-8214 javadoc updates 2011-04-12 13:23:14 +00:00
Rossen Stoyanchev 0c736776da SPR-8094 2011-04-12 10:46:57 +00:00
Rossen Stoyanchev 5486649394 Add UriTemplateServletHandlerMethodTests 2011-04-11 17:18:07 +00:00
Rossen Stoyanchev 767513de4e Add UriTemplateServletHandlerMethodTests 2011-04-11 17:17:51 +00:00
Rossen Stoyanchev 23e37b6842 SPR-8234 Switch to strongly typed custom argument resolvers property 2011-04-11 15:50:04 +00:00
Rossen Stoyanchev 313546ad1f SPR-8234 Argument resolver and return value handler configuration improvements 2011-04-11 12:37:33 +00:00
Rossen Stoyanchev 36970115ed Fix issues encountered in Greenhouse 2011-04-10 06:01:11 +00:00
Arjen Poutsma 28b6eae11a SPR-7354 - Added equivalent of JAX-RS @Consumes to Spring MVC 2011-04-08 13:33:58 +00:00
Arjen Poutsma 44b4f59c5e SPR-7354 - Added equivalent of JAX-RS @Consumes to Spring MVC 2011-04-08 12:06:53 +00:00
Arjen Poutsma 0cdb237576 SPR-7354 - Added equivalent of JAX-RS @Consumes to Spring MVC 2011-04-08 11:12:54 +00:00
Arjen Poutsma ff89c0e55a SPR-7354 - Added equivalent of JAX-RS @Consumes to Spring MVC 2011-04-08 10:50:45 +00:00
Arjen Poutsma bf6693dbc5 SPR-7354 - Added equivalent of JAX-RS @Consumes to Spring MVC 2011-04-08 09:26:17 +00:00
Rossen Stoyanchev 381af43f91 Javadoc updates 2011-04-07 22:16:41 +00:00
Rossen Stoyanchev 6fe0ff9e7b ModelAndViewContainer related refinements 2011-04-07 18:09:28 +00:00
Rossen Stoyanchev 2710870d9e SPR-8217 adding one class missed on last checkin 2011-04-06 20:33:10 +00:00
Rossen Stoyanchev 4c1f73ed83 SPR-8217 update MVC namespace to use HandlerMethod infrastructure 2011-04-06 20:28:47 +00:00
Rossen Stoyanchev ffec444434 Configurable arg resolvers and return value handlers 2011-04-06 16:55:21 +00:00
Rossen Stoyanchev ca9a3b4584 Replace ModelAndViewContainer parameter with Object 2011-04-06 15:30:19 +00:00
Rossen Stoyanchev 3ee6734424 SPR-8216 Replicate ServletAnnotationControllerTests for HandlerMethod infrastructure 2011-04-06 15:30:01 +00:00
Rossen Stoyanchev 28cdae2e50 SPR-8215 Fix issue with tests compiling 2011-04-06 11:52:18 +00:00
Rossen Stoyanchev acc75aa4b8 SPR-8215 Move HandlerMethod code into trunk 2011-04-06 11:30:59 +00:00
Chris Beams 5de35e8f92 Polishing 2011-03-10 14:08:58 +00:00
Rossen Stoyanchev 386d8fdaa6 SPR-6932 Add option to extract value from single-key models in MappingJacksonJsonView 2011-03-04 14:19:14 +00:00
Rossen Stoyanchev 761a836236 SPR-2692 Add URI template support to RedirectView 2011-03-03 15:54:29 +00:00
Rossen Stoyanchev 4027cbd952 Improve docs for MvcDefaultServletHandler container feature. 2011-03-01 14:32:34 +00:00
Rossen Stoyanchev 9779ca191c SPR-7976 Add MvcInterceptors features. 2011-02-22 16:13:04 +00:00
Chris Beams 9cc125531b Fix STS compatibility issues; other improvements
Revert changes to ParserContext, ReaderContext, and XmlReaderContext

    These changes cause cross-version incompatibilities at tooling time
    -- for instance, an STS version that ships with Spring 3.0.5
    classloads the ParserContext defined in that version, whereas it
    classloads NamespaceHandlers and BeanDefinitionParsers (by default)
    from the user application classpath, which may be building against
    3.1.0. If so, the changes introduced to these types in 3.1.0 are
    incompatible with expectations in the 3.0.5 world and cause all
    manner of problems.  In this case, it was NoSuchMethodError due to
    the newly-added XmlReaderContext.getProblemReporter() method; also
    IncompatibleClassChangeError due to the introduction of the
    ComponentRegistrar interface on ParserContext.

    Each of these problems have been mitigated, though the solutions
    are not ideal. The method mentioned has been removed, and instead
    the problemReporter field is now accessed reflectively.
    ParserContext now no longer implements ComponentRegistrar, and
    rather a ComponentRegistrarAdapter class has been introduced that
    passes method calls through to a ParserContext delegate.

Introduce AbstractSpecificationBeanDefinitionParser

    AbstractSpecificationBeanDefinitionParser has been introduced in
    order to improve the programming model for BeanDefinitionParsers
    that have been refactored to the new FeatureSpecification model.
    This new base class and it's template method implementation of
    parse/doParse ensure that common concerns like (1) adapting a
    ParserContext into a SpecificationContext, (2) setting source and
    source name on the specification, and (3) actually executing the
    specification are all managed by the base class.  The subclass
    implementation of doParse need only actually parse XML, populate
    and return the FeatureSpecification object.  This change removed
    the many duplicate 'createSpecificationContext' methods that had
    been lingering.

Minor improvement to BeanDefinitionReaderUtils API

    Introduced new BeanDefinitionReaderUtils#registerWithGeneratedName
    variant that accepts BeanDefinition as opposed to
    AbstractBeanDefinition, as BeanDefinition is all that is actually
    necessary to satisfy the needs of the method implementation. The
    latter variant accepting AbstractBeanDefinition has been deprecated
    but remains intact and delegates to the new variant in order to
    maintain binary compatibility.
2011-02-09 16:44:26 +00:00
Chris Beams 2f7c2230f0 Include license.txt and notice.txt in module JARs 2011-02-09 06:56:40 +00:00
Chris Beams 2d76dde611 Rename ExecutorContext => SpecificationContext 2011-02-08 19:08:41 +00:00
Chris Beams a2bc381ade Extract ProblemCollector interface 2011-02-08 19:07:03 +00:00
Chris Beams b4fea47d5c Introduce FeatureSpecification support
Introduce FeatureSpecification interface and implementations

    FeatureSpecification objects decouple the configuration of
    spring container features from the concern of parsing XML
    namespaces, allowing for reuse in code-based configuration
    (see @Feature* annotations below).

    * ComponentScanSpec
    * TxAnnotationDriven
    * MvcAnnotationDriven
    * MvcDefaultServletHandler
    * MvcResources
    * MvcViewControllers

Refactor associated BeanDefinitionParsers to delegate to new impls above

    The following BeanDefinitionParser implementations now deal only
    with the concern of XML parsing.  Validation is handled by their
    corresponding FeatureSpecification object.  Bean definition creation
    and registration is handled by their corresponding
    FeatureSpecificationExecutor type.

    * ComponentScanBeanDefinitionParser
    * AnnotationDrivenBeanDefinitionParser (tx)
    * AnnotationDrivenBeanDefinitionParser (mvc)
    * DefaultServletHandlerBeanDefinitionParser
    * ResourcesBeanDefinitionParser
    * ViewControllerBeanDefinitionParser

Update AopNamespaceUtils to decouple from XML (DOM API)

    Methods necessary for executing TxAnnotationDriven specification
    (and eventually, the AspectJAutoProxy specification) have been
    added that accept boolean arguments for whether to proxy
    target classes and whether to expose the proxy via threadlocal.

    Methods that accepted and introspected DOM Element objects still
    exist but have been deprecated.

Introduce @FeatureConfiguration classes and @Feature methods

    Allow for creation and configuration of FeatureSpecification objects
    at the user level.  A companion for @Configuration classes allowing
    for completely code-driven configuration of the Spring container.

    See changes in ConfigurationClassPostProcessor for implementation
    details.

    See Feature*Tests for usage examples.

    FeatureTestSuite in .integration-tests is a JUnit test suite designed
    to aggregate all BDP and Feature* related tests for a convenient way
    to confirm that Feature-related changes don't break anything.
    Uncomment this test and execute from Eclipse / IDEA. Due to classpath
    issues, this cannot be compiled by Ant/Ivy at the command line.

Introduce @FeatureAnnotation meta-annotation and @ComponentScan impl

    @FeatureAnnotation provides an alternate mechanism for creating
    and executing FeatureSpecification objects.  See @ComponentScan
    and its corresponding ComponentScanAnnotationParser implementation
    for details.  See ComponentScanAnnotationIntegrationTests for usage
    examples

Introduce Default[Formatting]ConversionService implementations

    Allows for convenient instantiation of ConversionService objects
    containing defaults appropriate for most environments.  Replaces
    similar support originally in ConversionServiceFactory (which is now
    deprecated). This change was justified by the need to avoid use
    of FactoryBeans in @Configuration classes (such as
    FormattingConversionServiceFactoryBean). It is strongly preferred
    that users simply instantiate and configure the objects that underlie
    our FactoryBeans. In the case of the ConversionService types, the
    easiest way to do this is to create Default* subtypes. This also
    follows convention with the rest of the framework.

Minor updates to util classes

    All in service of changes above. See diffs for self-explanatory
    details.

    * BeanUtils
    * ObjectUtils
    * ReflectionUtils
2011-02-08 14:42:33 +00:00
Rossen Stoyanchev 37e0a90350 SPR-7327 Add minOccurs=0 to sub-elements of mvc:annotation-driven and add more tests 2011-02-03 22:56:13 +00:00
Rossen Stoyanchev 7aaad37120 SPR-7327 add <mvc:argument-resolvers> namespace element 2011-02-03 15:22:00 +00:00
Rossen Stoyanchev 93de9622fc Remove code for parsing mvc:formatters (SPR-7732) 2011-01-31 21:30:48 +00:00
Rossen Stoyanchev abff2b959b SPR-7912 Add tests for FormattingConversionServiceFactoryBean, update reference docs, and remove mvc:formatters 2011-01-27 11:26:19 +00:00
Juergen Hoeller f4a2282d9d LocaleChangeInterceptor validates locale values in order to prevent XSS vulnerability (SPR-7779) 2011-01-26 20:30:30 +00:00
Rossen Stoyanchev f26b499cbd SPR-7732, SPR-6506, SPR-7191 MVC Namespace improvements to the annotation-driven element - custom message converters, formatters, and message codes resolver. 2011-01-25 17:49:57 +00:00
Arjen Poutsma 157623b47f SPR-6902 - @ResponseBody does not work with @ExceptionHandler 2011-01-10 12:26:57 +00:00
Keith Donald 0d28b70aa8 failing test case 2011-01-07 20:58:20 +00:00