WebJars are client-side web libraries (e.g. jQuery & Bootstrap) packaged into JAR (Java Archive) files.
WebJars can be added as dependencies to an app by simply adding them to the build.sbt file. There is also a helper library named webjars-play that makes it easy to reference WebJar assets. Here is an example build.sbt file with webjars-play and the bootstrap WebJar as dependencies.
Do the following steps to implement WebJars client-side web libraries with Play Framework:
- Add following entry into build.sbt file.
2. Add following entry into conf/routes file.
3. Add following entry into app/views/main.scala.html file.
Check the application and the code base on bellow links:
This is the fourth edition of this application. If you have any changes then feel free to send in pull requests and we would do the merges 🙂 Stay tuned.
For more information about WebJars visit the website: http://www.webjars.org