Insights and perspectives to keep you updated.

Play Framework 2.2 with WebJars client-side web libraries

Reading Time: < 1 minute 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 Continue Reading

Profile Management with Nice UI Interface in Node.js and MongoDB

Reading Time: < 1 minute Last week, we created a login demo template in Node.js and MongoDB. We also added signUp with FaceBook, Twitter and google. So that user would not need to signup manually. Now we have added profile management feature with a nice UI interface. Now uses can modify his profile detail along with his photo. This is demo template, which can be used as a starting point Continue Reading

Employee-Self-Service: Reactive and Non-Blocking Database Access using Play Framework and Anorm – (Part-4)

Reading Time: 2 minutes Last week, We have added Database Access as Reactive and Non-Blocking behaviour in Employee-Self-Service  application. Now we have added some more features. These are following: Achieving, Futures to use more idiomatic error handling. Replaced the embedded JS & CSS libraries with WebJars. Achieving, table pagination and sorting functionality. Before: def list() = Action.async { implicit request => val futureEmpList = scala.concurrent.Future { Employee.list } val timeoutFuture = Promise.timeout("Oops", Continue Reading

Mock Unit Testing using Mockito in Play Scala project

Reading Time: 2 minutes During Unit Testing in a Play Scala project, there arises a need to Mock certain Objects or Traits which are used in the unit, so that the unit being tested has a consistent interaction with its outside dependencies. But due to tight coupling or external dependencies, objects cannot be tested as a unit. So, we need to mock those external dependencies by adding fake external Continue Reading

Using Highcharts With Play Framework

Reading Time: 2 minutes Highcharts is a charting library written in pure HTML5/JavaScript, offering intuitive, interactive charts to your web site or web application. Highcharts are interactive Javascript charts which you can use very easily with any Play application. Its using graphical representation of your data. There are 2 types of Highchart API’s : 1. Highcharts API 2. Highstock API Implementetation of Charts: 1. Adding libraries for Highcharts  in Continue Reading

Idiomatic Error Handling in Scala

Reading Time: 3 minutes Error handling in Scala can just be written like Java. Put in a little bit of pattern matching magic and you are done. However, given a little use of Scala built-in terrific beauties it can be made much better. Let us have a look. Let us look at a quick example def sayHello(any: Any) = { any match { case x: String => "Hello" case Continue Reading

Sending mail functionality for Google App Engine

Reading Time: < 1 minute When we search for sending mail functionality then we get the solution using javax mail API. Following is the code of using javax.mail API : String emailId = <recipient-email-id>; Properties props = new Properties(); props.put(“mail.smtp.host”, “smtp.gmail.com”); props.put(“mail.smtp.port”, “587”); props.put(“mail.debug”, “true”); props.put(“mail.smtp.auth”, “true”); props.put(“mail.smtp.starttls.enable”, “true”); Session s = Session.getInstance(props, null); s.setDebug(true); Message message = new MimeMessage(s); InternetAddress from = new InternetAddress(,); InternetAddress to = new InternetAddress(emailId); Continue Reading

Linkedin sign-in functionality using Clojure

Reading Time: 2 minutes This blog will show you how to add Linkedin sign in functionality in your clojure web application. First Create an application on Linkedin by following the link https://developer.linkedin.com/documents/quick-start-guide Fill all the information and provide the Redirect URI which you use in your application .Once you create the application you will get the API Key and Secret Key. Let’s reference the [noir.response :as resp] [cheshire.core :as Continue Reading

Employee-Self-Service: Reactive and Non-Blocking Database Access using Play Framework and Anorm – (Part-3)

Reading Time: 1 minute Last week, We have added Reactive and Non-Blocking behaviour in Employee-Self-Service  application. Now we have implemented Database Access as Reactive and Non-Blocking: Before def list() = Action.async { implicit request => Employee.list match { case Right(data) => Promise.timeout(Ok(html.list(data)), 1 seconds) case Left(error) => Promise.timeout(Ok(html.list(Nil)), 1 seconds) } } After def list() = Action.async { implicit request => val futureEmpList = scala.concurrent.Future { Employee.list } val timeoutFuture = Promise.timeout(“Oops”, 10.second) Continue Reading

Integrate ReCaptcha in Lift application

Reading Time: < 1 minute ReCaptcha is a free CAPTCHA service which provides the strong security to application. In this blog we will learn how to integrate ReCaptcha in Lift-Scala application on lift-ajax form. Add following dependency in build.sbt "net.tanesha.recaptcha4j" % "recaptcha4j" % "0.0.7" Put ReCaptcha.scala file in your project from my gist Create account on ReCaptcha to get the public and private key for your domain Put public and Continue Reading