Coder Social home page Coder Social logo

davidmr001 / spring-boot-starter-velocity2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from andrehertwig/spring-boot-starter-velocity2

0.0 1.0 0.0 18 KB

Spring-Boot auto configuration for Velocity 2.0 Template Engine

License: Apache License 2.0

Java 100.00%

spring-boot-starter-velocity2's Introduction

Spring-Boot auto configuration for Velocity 2.0 Template Engine

Just a Spring-Boot starter for Velocity 2.0 Template Engine.

This starter just appends the Velocity Engine 2.0 to Spring context and you can configure it via spring properties. Because Velocity-Tools is still in version 2.0 and incompatible to Velocity-Template-Engine 2.0 there is no implmentation for tools. Furthermore this starter does not provide any ViewResolver.

Maven Central GitHub issues license

This is just a spare-time project. The usage of this tool (especially in production systems) is at your own risk.

Content

  1. Requirements, Dependencies
  2. Usage
  3. Configuration Properties
  4. Additional Things

Requirements, Dependencies

  • spring-boot
  • apache velocity 2.0

Unit-Tested with Spring Boot 1.5.6

Usage

<dependency>
	<groupId>de.chandre.velocity2</groupId>
	<artifactId>spring-boot-starter-velocity2</artifactId>
	<version>1.0.1</version>
</dependency>
	

Maybe you have to explicitly enable the component scan for the package:

@SpringBootApplication
@EnableAutoConfiguration
@ComponentScan(basePackages={"your.packages", "de.chandre.velocity2.spring"})
public class MyBootApplication {
 
}

Configuration Properties

For special configuration, please check the additional-spring-configuration-metadata.json

Additional Things

If you want to add velocity properties at runtime while application start-up, you are able to do that by implementing the de.chandre.velocity2.spring.Velocity2PropertiesOverrideHook.

Example:

@Configuration
@AutoConfigureBefore(Velocity2AutoConfiguration.class)
public class VelocityConfig
{
	private static final Logger LOGGER = LogManager.getFormatterLogger(VelocityConfig.class);
	
	@Bean
	public Velocity2PropertiesOverrideHook velocity2PropertiesOverrideHook(MyResourceManager rcMgr) {
		return new Velocity2PropertiesOverrideHook() {

			@Override
			public Properties override(Properties velocityProperties) {
				velocityProperties.put(RuntimeConstants.RESOURCE_MANAGER_INSTANCE, rcMgr);
				return velocityProperties;
			}
		};
	}
}

spring-boot-starter-velocity2's People

Contributors

andrehertwig avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.