Emerjoin / Hi-Framework-features

Java EE Framework
5 stars 1 forks source link

AjaxControllers - controller interfaces without implementations #125

Open Emerjoin opened 7 years ago

Emerjoin commented 7 years ago

Why do we need Ajax controllers

Most of the times we have controllers with action methods that simply invoke the callView method. In this cases we want to able to display the view without talking to server, meaning, we would only talk to the server when the view is not locally stored yet.

@Controller
public interface PeopleController{
     void list();
     void add();
}

Cached view eviction view

Implementing Ajax controllers creates the need of offering a Js API to evict cached views. The API method would be invoked for example on logout.

Cached view auto-update on-reload

If the user reloads the page, the browser will reach the server and retrieve new page content. Hi-Framework must update the cached HTML for the current URL upon page reload, evicting implicitly the current cached version.