1

From what I've heard, A controller command can be invoked from within a scriptlet. But I am not sure of other methods. Any code level information would be very helpful.

sreejith
  • 21
  • 2
  • 3
  • What is the use case under which you would want to do this, yes you can, but you shouldn't. If this is your plan, you are misusing the framework. – Michael Rasmussen Apr 30 '13 at 19:31
  • Thanks for the suggestion. This is just for knowledge sake as this was asked once when we had a discussion on WCS. – sreejith Jul 05 '13 at 09:09

4 Answers4

0

You can also try making AJAX call from the JSP to the controller command.

Deepak
  • 1
  • 1
0

You really shouldn't be directly executing a controller command from within the scriptlet code of a JSP. You could use AJAX to call a command service. Or you could use a DataBean Command, though they are really meant to be commands that populate the databean not really call controller commands. You may also be in a situation that you need to review your use of a controller command, possibly BOD commands would be a better fit if you are wanting to invoke a service from the JSP during the page generation.

mmphantom
  • 21
  • 2
0

You could create your own mapping of your ControllerCommand to REST.

http://www-01.ibm.com/support/knowledgecenter/SSZLC2_7.0.0/com.ibm.commerce.webservices.doc/tasks/twvrestsamplecmd.htm

Then you use the REST tag to run the ControllerCommand.

http://www-01.ibm.com/support/knowledgecenter/SSZLC2_7.0.0/com.ibm.commerce.component-services.doc/refs/rwvwcfresttag.htm

In the new implementation from IBM in FEP8 this will be done locally if possible and will therefor not add any extra network overhead.

Daniel Persson
  • 602
  • 7
  • 17
-1

By Using Databean also we can invoke controller commands.

ex : <wcbase:usebean>
Radim Köhler
  • 122,561
  • 47
  • 239
  • 335