AnsweredAssumed Answered

Erratic behaviour in webscript results output

Question asked by jlmarques on Mar 5, 2008
Hi, have this webscript that searches for keywords inside files. The problem is that when I reload the webscript the second time it does not return results and this error shows up in the tomcat console:

[Fatal Error] :1:1: Content is not allowed in prolog.

This is my webscript code:

<description>Retrieves content that matches the search criteria</description>
<format default="html">extension</format>

var store = avm.lookupStore("intranet");
var query = "TEXT:"+args.param;

var param = store.luceneSearch(query);

if (param == undefined)
   status.code = 404;
   status.message = "Keyword " + args.param + " not found.";
   status.redirect = true;
   var nodes = store.luceneSearch(query);
   model.resultset = nodes;

<#if resultset?size==0 >
<p>Não foram encontrados resultados.</p>
   <#list resultset as node>
       <#if node.isDocument>
         <#if node.xmlNodeModel?exists>
            <#assign dom=node.xmlNodeModel>
            <#if == 1>
            <#if dom.article?size == 1>
                  <p><a href="index.php?article=${dom.article.slug}" >continuar a ler</a><p>
            <h2>Ficheiro: <a href="http://localhost:8080${url.serviceContext}/api/node/content/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${}/${}">${}</a></h2>

Is it something to do with the transaction? I don't know why this happens. Some help would be appreciated :).