I think that folks at this point tend to frown on using servlets for rendering. JSP, Velocity, and Freemarker (perhaps ESP ;-) are better suited for that. Pure servlets, imho, should be used for front controllers and other such applications but should not do any display rendering.

-paddy

On Oct 31, 2007, at 2:32 PM, Lars Trieloff wrote:

Hi Felix,

I see scripts mainly as a mechanism to express rendering/behavior and servlets serve the same purpose, so from my level of abstraction, there is no conceptual difference.

Lars

Am 31.10.2007 um 22:27 schrieb Felix Meschberger:

Hi Lars,

Am Mittwoch, den 31.10.2007, 22:01 +0100 schrieb Lars Trieloff:
Is there a conceptual difference between servlets and scripts?

Yes and no :-) On the one hand scripts are just a special case of
servlets. But then scripts are loaded differently that servlets.

Servlets are registered with the ServletResolver (either manually as in
microsling or through the OSGi service registry as in Sling) while
scripts are dynamically resolved.

So, this is how the ServletResolver works:

 1. Find a servlet for the resource type
 2. Find a script for the request (mostly by the resource type again)
      (this step delegates to the ScriptResolver)
 3. Fall back to the default servlet

So, any solution involving the ServletResolver is inherently more
powerful than solutions limited to involve the ScriptResolver only. In
fact, we should not directly use the ScriptResolver and leave this to
the ServletResolver.

Regards
Felix



Reply via email to