AnsweredAssumed Answered

How to get an URL Paramter from Surf component

Question asked by ridmess on Dec 4, 2009

I have a problem to get url paramter, which I used in the Surf Component. When I call the webscript from repositoryhttp://localhost/surf/service/page?f=default&p=NewsDetails&details=test, I get any erro but when I call it from my web site, I get  this error:
500 Description:    An error inside the HTTP server which prevented it from fulfilling the request.

Message:   Failed to process template newsDetails.get.html.ftl
Exception:   freemarker.core.InvalidReferenceException - Expression args.details is undefined on line 3, column 3 in newsDetails.get.html.ftl.
Exception:   org.alfresco.web.scripts.WebScriptException - Failed to process template newsDetails.get.html.ftl
Server:   Alfresco Labs v3.0.0 (Stable r13140) schema 2.000
Time:   04.12.2009 12:44:52

the component desc

the web script desc:
  <description>Returns the main body of the News page</description>
  <!–<url>/newsDetails/{details}</url>  –>
   <format default="html">extension</format>

the web script ftl:
<#if newsliste?exists>

      Failed to connect to Alfresco repository.

the webscript js:
   // get a connector to the Alfresco repository
   var connector = remote.connect("alfresco-system");
   var jsonFeed = connector.get("/newsliste/get");

   var obj = eval('(' + jsonFeed + ')');
   if (obj)
      var newsliste = obj.newsl;

      model.newsliste = newsliste;


Thanks for your help