In my 1.x controller, I had this:
public static void language(final String language){ Lang.change(language); Header referer = request.headers.get("referer"); if(referer == null){ index(); }else{ redirect(referer.value()); } }
I would like to do the same in 2.x, but I got the impression that the functionality is no longer available. This is what I still have
def language(language:String) = Action { implicit request => // TODO change language val referer = request.headers.get("referer") referer.map{ referer => Redirect(referer, FOUND); }getOrElse( Ok(views.html.index()) ) }
source share