java - One action can have two method? -
in asp.net, 1 controller can have many actionresult return many ways.
public class homecontroller : controller { public actionresult index() { viewbag.message = "modify template jump-start asp.net mvc application."; return view(); } public actionresult about() { viewbag.message = "your app description page."; return view(); } public actionresult contact() { viewbag.message = "your contact page."; return view(); } }
how in java struts2, 1 action have 1 execute able return 1 way.
there's 1 index
in example, there's 1 execute
in s2 action.
actions may, however, have arbitrary number of methods. methods may called in number of ways, including configuration via annotations, xml, or using convention plugin or rest plugins.
in example don't show 1 method returning multiple ways, show multiple actions returning multiple ways, supported under struts 2 in similar ways.
Comments
Post a Comment