vraptor-freemarker

Sonatype helps open source projects to set up maven repositories on http://oss.sonatype.org.

GroupId

GroupId

br.com.caelum.vraptor
ArtifactId

ArtifactId

vraptor-freemarker
Last Version

Last Version

4.1.0-RC3
Release Date

Release Date

Type

Type

jar
Description

Description

vraptor-freemarker
Sonatype helps open source projects to set up maven repositories on http://oss.sonatype.org.
Project URL

Project URL

http://maven.apache.org
Source Code Management

Source Code Management

http://github.com/caelum/vraptor-freemarker

Download vraptor-freemarker

How to add to project

<!-- https://jarcasting.com/artifacts/br.com.caelum.vraptor/vraptor-freemarker/ -->
<dependency>
    <groupId>br.com.caelum.vraptor</groupId>
    <artifactId>vraptor-freemarker</artifactId>
    <version>4.1.0-RC3</version>
</dependency>
// https://jarcasting.com/artifacts/br.com.caelum.vraptor/vraptor-freemarker/
implementation 'br.com.caelum.vraptor:vraptor-freemarker:4.1.0-RC3'
// https://jarcasting.com/artifacts/br.com.caelum.vraptor/vraptor-freemarker/
implementation ("br.com.caelum.vraptor:vraptor-freemarker:4.1.0-RC3")
'br.com.caelum.vraptor:vraptor-freemarker:jar:4.1.0-RC3'
<dependency org="br.com.caelum.vraptor" name="vraptor-freemarker" rev="4.1.0-RC3">
  <artifact name="vraptor-freemarker" type="jar" />
</dependency>
@Grapes(
@Grab(group='br.com.caelum.vraptor', module='vraptor-freemarker', version='4.1.0-RC3')
)
libraryDependencies += "br.com.caelum.vraptor" % "vraptor-freemarker" % "4.1.0-RC3"
[br.com.caelum.vraptor/vraptor-freemarker "4.1.0-RC3"]

Dependencies

compile (3)

Group / Artifact Type Version
br.com.caelum : vraptor jar 4.2.0-RC3
javax.enterprise : cdi-api jar 1.1
org.freemarker : freemarker jar 2.3.16

provided (2)

Group / Artifact Type Version
javax.inject : javax.inject jar 1
org.mortbay.jetty : servlet-api jar 3.0.20100224

test (2)

Group / Artifact Type Version
junit : junit jar 4.8.2
org.mockito : mockito-core jar 1.8.5

Project Modules

There are no modules declared in this project.

vraptor-freemarker

Build status

A simple freemarker engine for rendering templates from within jar files, or rendering email etc.

installing

Vraptor-freemarker.jar can be downloaded from maven's repository, or configured in any compatible tool:

	<dependency>
		<groupId>br.com.caelum.vraptor</groupId>
		<artifactId>vraptor-freemarker</artifactId>
		<version>1.1.0</version>
		<scope>compile</scope>
	</dependency>

usage for rendering pages

	@Resource
	public class DashboardController {

		private final User user;
		private final Freemarker freemarker;

		public DashboardController(User user, Freemarker freemarker) {
			this.user = user;
			this.freemarker = freemarker;
		}

		@Path("/admin/dashboard")
		@Get
		public void list() throws IOException, TemplateException {
			freemarker.use("dashboard").with("currentUser", user).render();
		}

	}

or...

	@Resource
	public class DashboardController {

		private final User user;
		private final Result result;

		public DashboardController(User user, Result result) {
			this.user = user;
			this.result = result;
		}

		@Path("/admin/dashboard")
		@Get
		public void list() throws IOException, TemplateException {
			result.include("currentUser", user);
			result.use(FreemarkerView.class).withTemplate("dashboard");
		}

	}

usage for rendering emails

	String body = freemarker.use("send_mail_notification").with("currentUser", user).getContent();

usage when testing

	@Test
	public void testSomething() throws Exception {
		new DashboardController(new User(), new MockFreemarker()).list();
		// your assertions here
	}

help

Get help from vraptor developers and the community at vraptor mailing list.

br.com.caelum.vraptor

Caelum

Versions

Version
4.1.0-RC3
4.1.0-RC2
4.0.0
4.0.0-RC2
1.1.3
1.1.2
1.1.0
1.0.1