actions and methods

31 views
Skip to first unread message

Joseph Greenawalt

unread,
Oct 16, 2012, 7:01:01 PM10/16/12
to gae...@googlegroups.com
This might be more of a groovlet / groovy question, but since my project is gaelyk and there might be some differences.

Is there a built in way to do "actions" based on HTTP methods, like doGet or do I need to do the if request.method == "GET" paradigm? Or is there a better paradim in Gaelyk/Groovlets?

Thanks,
Joe

Joseph Greenawalt

unread,
Oct 16, 2012, 7:04:22 PM10/16/12
to gae...@googlegroups.com
Also, I forgot to ask, can I extend a base groovlet? 

Guillaume Laforge

unread,
Oct 16, 2012, 10:48:23 PM10/16/12
to gae...@googlegroups.com
Currently, Groovlet indeed don't support more action-oriented methods.
For that, you might be better of extending the GroovyServlet class from Groovy, or the GaelykServlet class, and add that method support yourself.

Guillaume

--
You've received this message because you've subscribed to the Gaelyk Google Group.
To send an email to the group, please write to: gae...@googlegroups.com
To unsuscribe from this group: gaelyk+un...@googlegroups.com
To show more options: http://groups.google.fr/group/gaelyk?hl=en



--
Guillaume Laforge
Groovy Project Manager
SpringSource, a division of VMware


Joseph Greenawalt

unread,
Oct 17, 2012, 12:27:51 AM10/17/12
to gae...@googlegroups.com
cool thanks.

Marcin Erdmann

unread,
Oct 17, 2012, 8:22:10 AM10/17/12
to gae...@googlegroups.com
Shouldn't you simply have different routes specified in routes.groovy
pointing to different groovlets for different actions?

Guillaume Laforge

unread,
Oct 17, 2012, 8:23:16 AM10/17/12
to gae...@googlegroups.com
That's indeed what we currently have to do.
But I think Joe wanted to have one Groovlet that'd have things like doGet, doPost methods, etc.
And that's not supported by Groovlets.

Joseph Greenawalt

unread,
Oct 17, 2012, 9:32:15 AM10/17/12
to gae...@googlegroups.com
Correct, Guillaume that was what I was wondering if it was possible.  But since it isn't I think I defaulted down the path of what Marcin suggested (hopefully).

get "/signup", forward: "signup.SignUpGET.groovy"

post "/signup", forward: "signup.SignUpPOST.groovy"


Which is fine, its just different way to think about it.  And i wanted to know my options before I paint myself in the corner.
Reply all
Reply to author
Forward
0 new messages