How to Manually throw error Pages in Play Framework?

http, http-status-code-404, java, playframework

Solution

Play `Controller` has `error()` and `notFound()` methods for this purpose.

Problem

How do I manually throw a `404` or `500` error in Play framework 1.2.x? I am currently rendering the `404.html` and `500.html` templates using `renderTemplate()` method. But how do I do it the proper way ?

Original source