Play framework 2 - isAuthenticated in Java
===

In my action i'd like to render different views (or maybe only display some other divs) depending on whether a user is authenticated or not. 

Should i do something like this:

    public static Result index() {	        
       if (Context.current().request().username().equals("")) {
            // user is NOT authenticated
            return ok(welcome.render());
        } else {
            // user is authenticated
            return ok(dashboard.render());
        }
    }

And how about checking if a user is authenticated in a view?
I know I can use the @Security.Authenticated(Secured.class) annotation, but how do things conditional?