Play Framework 2.2 with WebJars client-side web libraries

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:

  1. 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:

The live application is currently hosted at : http://employee-self-service.herokuapp.com/
The Github code for the project is at : https://github.com/knoldus/Employee-Self-Service

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

2 thoughts on “Play Framework 2.2 with WebJars client-side web libraries

Leave a Reply

%d bloggers like this: