Emerjoin / Hi-Framework-features

Java EE Framework
5 stars 1 forks source link

URL mapping #126

Open Emerjoin opened 7 years ago

Emerjoin commented 7 years ago

Why do we need URL Mapping?

To be able to have one AjaxController and one regular controller mapped to the same path but with different actions:

Example


@AjaxController
@Mapping("/order")
public interface OrderAjaxController {
    void items();
    void checkout();
}

@Mapping("/order")
public class OrderController extends Controller {     
     public void cancel() throws MvcException{
             this.callView();
     }      
}

Both controllers expose actions accessible using the following URLs:

The views of both controllers must be located under webapp/views/order/ directory.