Commit Graph

13 Commits

Author SHA1 Message Date
Rossen Stoyanchev d686f615f6 Fix typo in reference
Issue: SPR-13043
2015-05-18 15:24:21 -04:00
Juergen Hoeller dc39e3565c Doc example for custom Formatter as alternative to PropertyEditor in @InitBinder method
Issue: SPR-7773
2015-05-13 15:47:45 +02:00
Rossen Stoyanchev 2b528bb643 Improve and update docs on MvcUriComponentsBuilder
Issue: SPR-12617
2015-05-07 10:43:57 -04:00
Sebastien Deleuze a3159dfbf2 Add script based templating support
This commit adds support for script based templating. Any templating
library running on top of a JSR-223 ScriptEngine that implements
Invocable like Nashorn or JRuby could be used.

For example, in order to render Mustache templates thanks to the Nashorn
Javascript engine provided with Java 8+, you should declare the following
configuration:

@Configuration
@EnableWebMvc
public class MustacheConfig extends WebMvcConfigurerAdapter {

	@Override
	public void configureViewResolvers(ViewResolverRegistry registry) {
		registry.scriptTemplate();
	}

	@Bean
	public ScriptTemplateConfigurer configurer() {
		ScriptTemplateConfigurer configurer = new ScriptTemplateConfigurer();
		configurer.setEngineName("nashorn");
		configurer.setScripts("mustache.js");
		configurer.setRenderObject("Mustache");
		configurer.setRenderFunction("render");
		return configurer;
	}
}

The XML counterpart is:

<beans>
	<mvc:annotation-driven />

	<mvc:view-resolvers>
		<mvc:script-template />
	</mvc:view-resolvers>

	<mvc:script-template-configurer engine-name="nashorn" render-object="Mustache" render-function="render">
		<mvc:script location="mustache.js" />
	</mvc:script-template-configurer>
</beans>

Tested with:
 - Handlebars running on Nashorn
 - Mustache running on Nashorn
 - React running on Nashorn
 - EJS running on Nashorn
 - ERB running on JRuby
 - String templates running on Jython

Issue: SPR-12266
2015-04-22 08:47:04 +02:00
David Tombs 463878a03f Improve RedirectAttributes reference docs
The use of RedirectAttributes was documented in four places in the
reference documentation. This commit merges some of the places and links
properly between them.

Issue: SPR-12759
2015-04-13 13:41:58 -04:00
Sam Brannen 81a2cbb100 Polish HTTP caching sections in reference manual 2015-03-31 01:09:44 +02:00
Rossen Stoyanchev b620f34ad8 Minor doc update 2015-03-24 16:45:51 -04:00
Rossen Stoyanchev 209e8de188 Document async request processing enhancements
Generally update chapter and add documentation for 4.2 including
the return value types ResponseBodyEmitter, SseEmitter, and
StreamingResponseBody.

Issue: SPR-12672
2015-03-24 16:05:28 -04:00
Rossen Stoyanchev 95f6e4cc9b Support StreamingResponseBody return value type
Issue: SPR-12831
2015-03-23 15:38:52 -04:00
Brian Clozel 90ed0cf04c Document HTTP caching features in 4.2
Issue: SPR-11792
2015-03-23 18:05:53 +01:00
Stephane Nicoll bd6d974561 Fix Admonition syntax
The upgrade to a more recent asciidoc format led to a bunch of of
broken Admonition as the text block now requires four equal signs while
previous versions tolerated only 3.

Issue: SPR-12791
2015-03-07 07:30:52 +01:00
Brian Clozel 74072237ee Break down Core and Web chapters in reference doc
Core and Web chapters are important chapters in the Spring Framework
reference documentation, and splitting them in multiple files will
help to evolve the documentation while not creating too many files.

Issue: SPR-12309
2015-03-06 16:59:25 +01:00
Brian Clozel 0baf228db5 Modularize asciidoc documentation
The reference documentation is now organized in asciidoc bookparts.
Bookparts sections can be also put in separate files, when their
size and theme are important enough to justify that.

Documentation Layout:
```
index
  |-- overview
  |
  |-- whats-new
  |
  |-- core
  |   |-- core-beans
  |   |-- core-aop
  |-- testing
  |
  |-- data-access
  |
  |-- web
  |   |-- web-mvc
  |   |-- web-view
  |-- integration
  |
  |-- appendix
      |-- appx-spring-tld
      |-- appx-spring-form-tld
```

Supersedes and closes #641

Issue: SPR-12309
2015-03-06 10:54:13 +01:00