metamug / mason

REST APIs with JSP tags, SQL and much more.
https://metamug.github.io/mason
Other
26 stars 10 forks source link

Execute script plugin #146

Closed d3ep4k closed 4 years ago

d3ep4k commented 4 years ago

Instead of having script tag, we can use script plugin with execute tag.

d3ep4k commented 4 years ago

Similarly XRequest plugin can also be built. There is no need for m:xrequest tags or m:script

d3ep4k commented 4 years ago
<jsp:directive.include file="../fragments/mason-init.jspf"/>

<m:resource>
    <m:request method="GET">
        <m:execute className="com.metamug.mason.plugin.GroovyRunner" var="res" >
            <m:arg name="file" value="test.groovy" />
        </m:execute>
        <c:set target="${output}" property="response" value="${res}"/>
    </m:request>
</m:resource>