cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple controllers for web scripts?

nenad982
Champ on-the-rise
Champ on-the-rise
Hi all,

is it possible to create multiple controllers for the same service? For example, I want to have one Java-backed controller and one Java Script controller for POST Web Script, and to force them to execute in order that I want.

I already have Java Script controller (this is Alfresco's web script, not a custom one), and I need to change response header. I didn't found the way to set response headers in server-side Java Script, so my idea is to create another Java-backed controller, and to set this headers in Java. Is this possible and is this the right way if we have requirement to change response headers and currently we only have Java Script controller?

thank in advance…
3 REPLIES 3

mitpatoliya
Star Collaborator
Star Collaborator
I don't think it is possible and if possible some where we need to define the execution sequence.
Also, It is not advisable.
Better you put all logic under any one of the controller.

nenad982
Champ on-the-rise
Champ on-the-rise
Hi mitpatoliya,

thanks for your reply. My original requirement is to change response headers. Do you know is there possibility to change these headers in server-side Java Script?

thanks once again…

mitpatoliya
Star Collaborator
Star Collaborator
If you have complex processing required in the controller it is always advisable to use the JAVA controller as in java script you will be bind by the set of limited API's provided by alfresco.
Where as in JAVA you will have more flexibility.