Sample for implementing a simple command with no interface
You might implement a simple command with no interface if you simply want to route the user from one page to another.
Implementing a simple command with no interface
Here
is the sample code for when you have a command that does not implement
anything. For example, when you have routing from one page to another
page.
public class DefaultNavigator {
public String execute(){
System.out.println("DefaultNavigator.execute() Dependency injection is tested ");
return "success";
}
}
Here is the sample configuration in the flow-config.xml
file:
<flow path="setViewItem" command="com.ibm.ccd.ui.util.DefaultNavigator" method="">
<flow-dispatch name="newViewOfItem" location="/ccd_content/new_single_edit_ui.jsp"
dispatchType="forward"/>
</flow>
Note: The DefaultNavigator class is pre-built
and it can be directly used for the purpose of routing.