Dashboard > RIFE > ... > Web engine > Groovy support
RIFE Log In | Sign Up   View a printable version of the current page.
Groovy support


Added by Geert Bevin, last edited by Geert Bevin on Apr 10, 2005  (view change)
Labels: 
(None)

When Groovy is present in the classpath of the web application, it's now possible to implement elements in this very nice scripting language. The only requirement is that the source files have to have the .groovy extension.

For example, Simple.groovy:

import com.uwyn.rife.engine.Element

class simple extends Element
{
    void processElement()
    {
        if (hasSubmission("login"))
        {
            print(getParameter("login")+","+getParameter("password"))
        }
        else
        {
            switch (getInput("input1"))
            {
                case "form":
                    print("""
<html><body>
<form action="${getSubmissionQueryUrl("login")}" method="post">
<input name="login" type="text">
<input name="password" type="password">
<input type="submit">
</form>
</body></html>
""")
                    break
                default:
                    print(getInput("input1")+","+getInput("input2"))
                    break
            }
        }
    }
}



Are you enjoying Confluence? Please consider purchasing it today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.1a Build:#515 May 19, 2006) - Bug/feature request - Contact Administrators