CloudMVC: Spring MVC + Gaelyk

27 views
Skip to first unread message

Sean Gilligan

unread,
May 5, 2010, 7:27:47 PM5/5/10
to gae...@googlegroups.com
OK, I created a github project with a simple Spring MVC configuration
and an index.gtpl at the root.

Loading requests for the /counter URL use about 3.5 cpu_ms according to
the log.
Loading requests for the / URL (index.gptl) average about 9.5 cpu_ms
(but I'm pretty sure SpringMVC is loading as well)

I don't know what a simple servlet would use, nor do I know what the JVM
startup uses.

It would seem like using Google's measurement of cpu_ms is probably the
best comparison of startup time between alternatives, right?

The site is here:
http://cloudmvc.appspot.com/

The source is here:
http://github.com/msgilligan/CloudMVC

I didn't put a license or copyright on this yet, but if it turns into
more than just an experiment, I'd like to use ASL2.

What I'd like to be able to do is load scripted and pre-compiled .gtpl
files from SpringMVC (generally scripted for development and
pre-compiled for deployment)

Any feedback or suggestions are more than welcome.

-- Sean



--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes Gaelyk.
Pour envoyer un message à ce groupe, adressez un e-mail à gae...@googlegroups.com.
Pour vous désabonner de ce groupe, envoyez un e-mail à l'adresse gaelyk+un...@googlegroups.com.
Pour plus d'options, consultez la page de ce groupe : http://groups.google.com/group/gaelyk?hl=fr

marc fawzi

unread,
May 5, 2010, 8:33:37 PM5/5/10
to gae...@googlegroups.com
So this is interesting

I just want to add that working with Scala on GAE the Scala classes, which power the tag libs, are compiled prior to deployment, and the JSP (with custom Scala taglibs) loads pretty fast, without the huge cold start delay, but the speed from "hot" state is not much better (for the limited "hello world" type cases I ran so far) than running .gtpl or .groovy scripts.

Moving on to JSF 2.0 now on GAE (with Scala) and eventually hoping to use RichFaces

I'm pretty sure I can substitute Groovy for Scala and things will work just as well.

marc fawzi

unread,
May 17, 2010, 12:29:31 PM5/17/10
to gae...@googlegroups.com
Hey Sean

I'm gaining interest in Spring and plan on having managed beans written in Groovy and Scala

Do you have any written notes on how you produced your minimalistic version of the Spring framework?

In other words, what did you leave out? and what configurations did you have to make for GAE?

I haven't used Spring before so I wouldn't be able to tell by simply glancing at your github source.

Thanks in advance

Marc
 

On Wed, May 5, 2010 at 4:27 PM, Sean Gilligan <se...@msgilligan.com> wrote:



--
Marc

"We assume that space-time at the Planck scale is discrete, quantised in Planck units and "qubitsed" (each pixel of Planck area encodes one qubit), that is, quantum space-time can be viewed as a quantum computer. Within this model, one finds that quantum space-time itself is entangled, and can quantum-evaluate Boolean functions which are the laws of Physics in their discrete and fundamental form." --Paola Zizzi

Jeff Schwartz

unread,
May 17, 2010, 2:02:30 PM5/17/10
to gae...@googlegroups.com
This is very interesting. I will enjoy following the progress on this. If you are going to do Spring development then I would suggest using SpringSource STS which is an Eclipse derivative. Lots of good built in tools and wizards to make dealing with the application.config easier.

Jeff
--
--
Jeff

Sean Gilligan

unread,
May 17, 2010, 2:38:52 PM5/17/10
to gae...@googlegroups.com
marc fawzi wrote:
> I'm gaining interest in Spring and plan on having managed beans
> written in Groovy and Scala

Cool!

> Do you have any written notes on how you produced your minimalistic
> version of the Spring framework?


Sadly, no. If I recall correctly, I started with a Gaelyk project and
created an Ant build for it. I then used a simple SpringMVC sample from
someone's blog and then added JARs until I got it to work.

I did a lot of work with Spring MVC in the past, but I've been out of
the loop for the last 2 years. There may be an even more minimalistic
approach than what I have. (I'm not sure what the overhead of the
Annotation-based configuration versus other approaches like XML or
perhaps even a code-based approach.)

> In other words, what did you leave out? and what configurations did
> you have to make for GAE?

I didn't leave stuff out, I started with Gaelyk and added stuff in.

Namely:

1) Added SpringDispatcher servlet to web.xml
2) Added SpringDispatcher-servlet.xml
3) Added Jars to lib directory
4) Created Controllers in com.msgiligan.cloudmvc.controller

> I haven't used Spring before so I wouldn't be able to tell by simply
> glancing at your github source.

The github source neither includes the JARs or lists them. I didn't
want to check in the binaries and haven't yet spent the time to get them
loading with Maven/Ivy. Here's the full list:

apache-mime4j-0.6.jar
appengine-api-1.0-sdk-1.3.0.jar
appengine-api-labs-1.3.0.jar
avalon-framework-4.1.3.jar
commons-codec-1.3.jar
commons-logging-1.1.1.jar
gaelyk-0.3.2.jar
gdata-core-1.0.jar
google-collect-1.0-rc1.jar
groovy-all-1.7-rc-1.jar
httpclient-4.0.1.jar
httpcore-4.0.1.jar
httpmime-4.0.1.jar
log4j-1.2.12.jar
logkit-1.0.1.jar
org.springframework.asm-3.0.0.RELEASE.jar
org.springframework.beans-3.0.0.RELEASE.jar
org.springframework.context-3.0.0.RELEASE.jar
org.springframework.context.support-3.0.0.RELEASE.jar
org.springframework.core-3.0.0.RELEASE.jar
org.springframework.expression-3.0.0.RELEASE.jar
org.springframework.web-3.0.0.RELEASE.jar
org.springframework.web.servlet-3.0.0.RELEASE.jar
servlet-api-2.3.jar

There may be some extras in here that aren't actually used.

Sean Gilligan

unread,
May 17, 2010, 2:44:13 PM5/17/10
to gae...@googlegroups.com
Jeff Schwartz wrote:
> This is very interesting. I will enjoy following the progress on this.
If it's OK with Guillaume, I'll keep discussing it on this list as my
intention is to integrate the Gaelyk helpers and use Groovy templates
somehow.
I also thought it might be interesting to create a Gaelyk plugin for
SpringMVC. I think that would be fairly straightforward. I'd also
love to get something going where the dependencies are pulled out of
Maven repos with Ivy or some such tool. Has anyone done that with Gaelyk?

> If you are going to do Spring development then I would suggest using
> SpringSource STS which is an Eclipse derivative.

That is exactly what I used. It worked well. (Although I generally
focus on command-line builds and just use Eclipse/STS for editing with
code-completion)

Guillaume Laforge

unread,
May 17, 2010, 3:30:29 PM5/17/10
to gae...@googlegroups.com
Hi,

On Mon, May 17, 2010 at 20:44, Sean Gilligan <se...@msgilligan.com> wrote:
> Jeff Schwartz wrote:
>>
>> This is very interesting. I will enjoy following the progress on this.
>
> If it's OK with Guillaume, I'll keep discussing it on this list as my
> intention is to integrate the Gaelyk helpers and use Groovy templates
> somehow.

Well, it's getting a bit out of scope if not out of topic, as there's
not much left from Gaelyk in those discussions.
So... well.. as it's getting quite further from Gaelyk, perhaps just
keep here the specific Gaelyk bits, to avoid boring those who don't
care about this new framework you're inventing here.

> I also thought it might be interesting to create a Gaelyk plugin for
> SpringMVC.  I think that would be fairly straightforward.   I'd also love to
> get something going where the dependencies are pulled out of Maven repos
> with Ivy or some such tool.  Has anyone done that with Gaelyk?

See my email on Maven integration.

[...]

--
Guillaume Laforge
Groovy Project Manager
Head of Groovy Development at SpringSource
http://www.springsource.com/g2one

Scott

unread,
May 17, 2010, 5:44:25 PM5/17/10
to Gaelyk
Gaelyk + Maven +/- Spring Security
http://code.google.com/p/maven-gaelyk/

I've got Spring MVC and Spring Security both working w/ Gaelyk as
plugins. Will release next week after I clean them up a bit.

Sean Gilligan

unread,
May 17, 2010, 7:36:20 PM5/17/10
to gae...@googlegroups.com
Guillaume Laforge wrote:
> So... well.. as it's getting quite further from Gaelyk, perhaps just
> keep here the specific Gaelyk bits, to avoid boring those who don't
> care about this new framework you're inventing here.
>

I'm not trying to invent a new framework. What I want to do is develop
some components that are reusable in Gaelyk, Grails, and plain-old
Spring MVC applications.

My focus for now is GAE/Gaelyk, but I'd like the components to be able
to be used in those other environments. I don't want to write code that
is completely tied to GAE. I'd like to be able to run on other JVM
environments whether they be "cloud-based" or more traditional
Tomcat/Jetty/AppServer/Servlet environments.

A key goal, of course, is for the components to initialize quickly when
a new JVM is started.

So the idea is a lightweight configuration (or profile) of Spring MVC.
(An alternative to using SpringMVC might be to use the Servlet 3.0
stuff. At first glance, it looks a lot like Spring MVC, but I haven't
used it yet and it's not supported on GAE yet, either)

To tie this back to Gaelyk, here are some points of integration I'm
potentially interested in:

1) A Gaelyk plugin for installing Spring MVC into a Gaelyk environment
2) Easy inclusion of the Gaelyk jar in Spring MVC and/or Grails projects
3) Easy access to Gaelyk helpers in Spring MVC controllers and/or views
4) Ability to use Groovy templates (with Gaelyk) in Spring MVC views
5) Ability to use pre-compiled Groovy templates (with Gaelyk) in Spring
MVC views

Does this make sense?

As a separate aside: I'd also potentially be interested in using GSP
pages and taglibs in Spring MVC and/or Gaelyk, but last I heard they
weren't decoupled from Grails. I also wonder if there would be any
performance issues on load-requests. Obviously it would be best if they
could be pre-compiled.

>> I also thought it might be interesting to create a Gaelyk plugin for
>> SpringMVC. I think that would be fairly straightforward. I'd also love to
>> get something going where the dependencies are pulled out of Maven repos
>> with Ivy or some such tool. Has anyone done that with Gaelyk?
>>
>
> See my email on Maven integration.
>

I saw that message. I was looking for something that lets me pull jars
from Maven repos without actually using Maven (something like Ivy or Grape)

It looks like what he's doing is using Maven to manage Gaelyk projects -
which might be a good approach for me, actually. I went cold turkey on
Maven a few years back, but it might be time to give Maven another look.

There are so may build solutions to choose from these days:

1) Plain old Ant
2) Ant with Ivy for pulling Jars
3) Ant with Maven Ant tasks for pulling Jars
4) Gant
5) Gradle
6) Gaelyk (Antbuilder)
7) Grails (moving to Gradle?)
8) Maven 2
9) Maven 3 (Now in beta)


I've been leaning towards #1 and #2, but haven't mastered Ivy yet.
Guillaume it looks like you're using #6 for Gaelylk and Gaelyk plugins
and Scott is using #8. Too many choices -- argh.

-- Sean






> [...]

Sean Gilligan

unread,
May 17, 2010, 8:05:17 PM5/17/10
to gae...@googlegroups.com
Scott wrote:
> Gaelyk + Maven +/- Spring Security
> http://code.google.com/p/maven-gaelyk/
>
> I've got Spring MVC and Spring Security both working w/ Gaelyk as
> plugins. Will release next week after I clean them up a bit.
>

I'm looking forward to seeing that. You're addressing several of the
same issues I'm wrestling with.

Thanks!
Reply all
Reply to author
Forward
0 new messages