public class Application extends Controller {
public static void index() {
render();
}
}
public class Application extends Controller {
public void index() {
render();
}
}
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
I like using static methods for controlers, because a controler is stateless.
A non static method can access the private attributes, that represent the state.
A static method not.
For example, in JSF, a statefull framework, a managed bean has
non-static actions, that use the state saved in private attributes.
I do not know whether that would be the explanation for Play!
creators, but that is how I understood this.
Yann
I think the use of static is perfect here.
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/vcU0hzBgASUJ.