i) Controller command is the main command which will be used to call from the JSP to process the request, but task command is used to perform some specific task like inventory check, price check etc. So task commands are commands which perform specific task for controller command.
ii) Controller Command is required to be configured in the struts-config file, but task command is not required to be configured in struts as they are not directly executed through URL.
iii) Controller commands can be scheduled using a scheduler job but task commands can’t be scheduled.
iv) Controller commands need resource level access control polocies to be defined and executed wheras task command does not need access control as this is executed from a controller command which already has the policies defined.
How to pass parameters to a Controller command
1.Pass parameters through URL parameters.
2.Pass parameters using Struts-config files.
3.Pass parameters using CMDREG table input properties column.
How to pass parameters to a task command.
Create a getter and setter methods in the task command to pass parameters to the task command.Hence the calling command can pass parameters as required.
Can we call controller command from a task command?
Yes we can call the controller command from a task command same as how we call task command from a controller. (Using command factory CreateCommand() method).
No comments:
Post a Comment