Neo
Neo

Reputation: 3705

Dropwizard views: add ViewBundle

I am trying to follow this tutorial to create DropWizard views. However, when I try to addBundle(new ViewBundle()), it fails to find (or import) ViewBundle. What am I missing here?

Upvotes: 2

Views: 1837

Answers (2)

bronzeiii
bronzeiii

Reputation: 1

You will need to choose one of the view template. As of writing, Dropwizard supports FreeMarker and Mustache. Instead of including dropwizard-view dependency, you should choose either dropwizard-views-mustache or dropwizard-views-freemarker, and dropwizard-view will be included as dependency.

Upvotes: 0

Neo
Neo

Reputation: 3705

The dependency dropwizard-views was missing in my maven pom file. Adding the dependency solved the issue.

<dependency>
        <groupId>io.dropwizard</groupId>
        <artifactId>dropwizard-views</artifactId>
        <version>${dropwizard.version}</version>
</dependency>

Upvotes: 9

Related Questions