[2.2 java] Configure 404 page

128 views
Skip to first unread message

Ricardo Sacramento

unread,
Oct 13, 2013, 2:36:40 AM10/13/13
to play-fr...@googlegroups.com
Please,  how configure a 404 page in play 2.2 ?

On 2.1 is:

@Override

public Result onHandlerNotFound(RequestHeader request) {

  return Results.notFound(views.html.not_found.render());

}

Ricardo Sacramento

unread,
Oct 14, 2013, 7:26:49 AM10/14/13
to play-fr...@googlegroups.com
Anyone can help me?

Jose Alfonso Mora Lores

unread,
Oct 14, 2013, 10:22:32 AM10/14/13
to play-fr...@googlegroups.com
At App/Global.java try this:

import static play.mvc.Results.*;

@Override
    public Result onHandlerNotFound(RequestHeader request) {
        return notFound(views.html.errores.error404.render());
    } 


Ricardo Sacramento

unread,
Oct 14, 2013, 12:43:53 PM10/14/13
to play-fr...@googlegroups.com
This is for 2.1.

Similiar code I have posted.
I need for play 2.2


Em domingo, 13 de outubro de 2013 03h36min40s UTC-3, Ricardo Sacramento escreveu:

Guillaume Bort

unread,
Oct 14, 2013, 1:05:17 PM10/14/13
to play-fr...@googlegroups.com
I guess that `onHandlerNotFound` now returns a Promise<SimpleResult>. You can create a direct successful promise of result using Promise.pure(...)


--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Reply all
Reply to author
Forward
0 new messages