https://github.com/ghimisradu/spring-velocity-adapter
Velocity view resolver adapter for Spring 5
https://github.com/ghimisradu/spring-velocity-adapter
spring spring-velocity-adapter velocity
Last synced: 5 months ago
JSON representation
Velocity view resolver adapter for Spring 5
- Host: GitHub
- URL: https://github.com/ghimisradu/spring-velocity-adapter
- Owner: ghimisradu
- License: apache-2.0
- Created: 2017-12-17T23:49:53.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-16T12:25:21.000Z (over 3 years ago)
- Last Synced: 2024-04-24T06:19:47.191Z (about 2 years ago)
- Topics: spring, spring-velocity-adapter, velocity
- Language: Java
- Size: 38.1 KB
- Stars: 8
- Watchers: 0
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# spring-velocity-adapter
Velocity view resolver adapter for Spring 5
## Usage
Add the following dependency into your pom.xml:
```xml
com.shield-solutions
spring-velocity-adapter
1.0.0.RELEASE
```
Initialize the velocity view resolver inside your spring ```java @Configuration``` annotated classes:
```java
...
@Bean
public ViewResolver viewResolver() {
VelocityViewResolver viewResolver = new VelocityViewResolver();
viewResolver.setSuffix(".vm.html");
return viewResolver;
}
...
@Bean
public VelocityConfigurer velocityConfigurer() {
VelocityConfigurer vc = new VelocityConfigurer();
vc.setResourceLoaderPath("WEB-INF/velocity");
return vc;
}
```