AnsweredAssumed Answered

Alfresco share java backed webscript not working.

Question asked by dynamolalit on Apr 8, 2014
Latest reply on Apr 15, 2014 by jpotts
Hi,

I have created a webscript for share which is javascript based as attached @ https://issues.alfresco.com/jira/browse/ALF-20915 & it is working fine as expected.I can call it @ http://localhost:8080/share/page/com/acc/search/fed/iwFedSearch?keyword={keyword} & it works fine providing me siteId variable i set in controller.

Next i planned to use java controller instead of javascript where in java business logic, i am calling solr for search. I have created custom-slingshot-context.xml for same along with all other files(also attached @ https://issues.alfresco.com/jira/browse/ALF-20915).

While i am trying to invoke java backed webscript using  same url @ http://localhost:8080/share/page/com/acc/search/fed/iwFedSearch?keyword={keyword}, i am getting below error in browser.

<blockquote>
{
    "status" :
  {
    "code" : 500,
    "name" : "Internal Error",
    "description" : "An error inside the HTTP server which prevented it from fulfilling the request."
  }, 
 
  "message" : "03080023 Failed to process template ie\/iw\/components\/search\/fed\/iwFedSearch.get.json.ftl", 
  "exception" : "org.springframework.extensions.webscripts.WebScriptException - 03080023 Failed to process template ie\/iw\/components\/search\/fed\/iwFedSearch.get.json.ftl",
 
  "callstack" :
  [
       ""      ,"freemarker.core.InvalidReferenceException: Expression siteId is undefined on line 1, column 30 in ie\/iw\/components\/search\/fed\/iwFedSearch.get.json.ftl."
      ,"freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125)"

</blockquote>


After much of head scratching, concluded that it is not able to call java controller where i am using declarative webscript to set model variable where i am setting siteId. As it is not able to invoke java controller, it regards siteId as undefined.

Can anybody help?

Outcomes