Search code examples
web-scrapingalfrescoalfresco-shareweb-scripting

How to write a webscript to returns the ticket for the current user?


I need to implement a web script that generates a returns the ticket for the current user. This web script is addressed by the URI I use to setup a URLConncetion. The ticket should be contained in the response body, which I need to evaluate in my JSP (or Java code) to extract the ticket. How can be done by a simple JavaScript / FreeMarker web script, using the JavaScript session root scope object to retrieve the ticket, i.e. session.getTicket() ? Can any one pls write the steps to do?


Solution

  • ticket.get.html.ftl (or json or whatever you want):

    ${session.ticket}