Is it possible to work with GSP (groovy server pages) without the whole grails stuff?

opensas picture opensas · Jan 28, 2009 · Viewed 8.1k times · Source

I'd just like to play a little bit with groovy

I was thinking about developing my own-tiny web framework, something very simple and manageable...

So i'd like tou use GSP pages whtout having to install the whole grails stuff, with all its dependencies and behind-the-scenes frameworks...

can anyone provide me detailed instructions on what to download, where to install, how to configure tomcat, etc...


some info I've found so far

Groovy Servlets

GSP Tag Reference

this is pretty close to what I'm looking for, but still don't know what to download, where to save it, etc...

http://groovy.codehaus.org/GSP

And look what it says here...

GSP are not maintained as a standalone module. But it has been forked and reintegrated in Grails.

?

Answer

opensas picture opensas · Jan 29, 2009

Well, it seems like it wasn't so hard in deed as I expected

just had to copy groovy-all-1.5.7.jar

from C:\java\groovy-1.5.7\embeddable

to C:\java\Tomcat 6.0\lib

and add the following lines to C:\java\Tomcat 6.0\conf\web.xml

  <!-- Groovy mapping - sas 2009-01-29 -->
<servlet>
    <servlet-name>Groovy</servlet-name>
    <servlet-class>groovy.servlet.GroovyServlet</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>Groovy</servlet-name>
    <url-pattern>*.groovy</url-pattern>
</servlet-mapping>

<servlet>
    <servlet-name>GroovyTemplate</servlet-name>
    <servlet-class>groovy.servlet.TemplateServlet</servlet-class>    
</servlet>
<servlet-mapping>
    <servlet-name>GroovyTemplate</servlet-name>
    <url-pattern>*.gsp</url-pattern>
</servlet-mapping>

and it worked!!!

I haven't even downloaded the grails installer...

could it really be that easy???

here are some links

http://noor.ojuba.org/2008/06/groovlets-setting-up/