mirror of
https://github.com/ralscha/extdirectspring.git
synced 2026-10-09 09:18:19 +02:00
Page:
Setting Up Spring Java
Pages
@JsonView
Api
Changelog
Changelog1_0_x
Changelog1_1_x
Changelog1_2_x
Changelog1_3_x
Changelog1_4_x
Changelog1_5_x
Changelog1_6_x
Config Spring Java Config
Config SpringXML
Configuration
Development
Form Load Method
Form Post Exception Handling
Form Post Method
Form Post Method1_0_x
Form Post Method1_1_x
Form Post With Upload
Form Post With Upload1_0_x
Form Post With Upload1_1_x
Home
Links
Migraton1_0_to_1_1
ModelGenerator
ModelGeneratorAPT
Polling Method
SSE Method
Setting Up Spring Java
Setup Maven
Simple Method
Simple Named Parameter Method
Store Modify Method
Store Read Method
Tree Load Method
No results
1
Setting Up Spring Java
Ralph Schaer edited this page 2012-07-10 06:16:00 +02:00
Table of contents
How to setup ExtDirectSpring with Spring JavaConfig
A setup with JavaConfig still needs the DispatcherServlet described here.
The rest of the configuration is a translation of the XML Setup.
@Configuration
@EnableWebMvc
@ComponentScan(basePackages = "ch.ralscha.extdirectspring"}
public class WebConfig {
@Bean
public MultipartResolver multipartResolver() {
CommonsMultipartResolver resolver = new CommonsMultipartResolver();
resolver.setMaxUploadSize(100000);
return resolver;
}
//some more configuration
}
The MultipartResolver is only needed for file uploads. The CommonsMultipartResolver needs two additional libraries (commons-fileupload and commons-io)
On a Servlet 3.0 container you could use the StandardServletMultipartResolver. The two libraries commons-fileupload and commons-io are no longer needed.
@Bean
public MultipartResolver multipartResolver() {
return new StandardServletMultipartResolver();
}
If you use this configuration don't forget to enable multipart support on the DispatcherServlet ({{{}}}). See XML Setup.
Table of Contents
- Introduction
- Changelog 1.7.x
- Setup Maven
- Configuration
- Server Methods
- Model Generator
- Model Generator APT
- Development
- Links