[ 
https://issues.apache.org/jira/browse/SLING-64?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12535851
 ] 

Bertrand Delacretaz commented on SLING-64:
------------------------------------------

>  * Merge the DefaultSlingServlet and the SlingPostServlet to a single 
> DefaultSlingServlet
>  * Replace Rhino and Velocity servlets by respective ScriptEngines (and 
> define the interface for that)
 >  * Refactor the SlingScriptResolver such that after resolving the script, it 
 > is also evaluated through a ScriptEngine
>   * Refactor MicroSlingServlet such, that
>            (1) check for a servlet by resource type
>            (2) try to evaluate a script
>            (3) fall back to the DefaultSlingServlet
> * Also in the MicroSlingServlet register servlets by type (currently there 
> are none of course)

I'm ok with all that, except maybe swapping 2) and 1), i.e. checking for a 
script first, and if there's none look for a servlet?

The rationale would be that servlets implement "standard" mechanisms which can 
be overridden by scripts.

But I'm not sure if that's the best way, we can probably go as you suggest and 
maybe change if there's a real need to.

> Refactor Servlets and Script resolution
> ---------------------------------------
>
>                 Key: SLING-64
>                 URL: https://issues.apache.org/jira/browse/SLING-64
>             Project: Sling
>          Issue Type: Improvement
>          Components: microsling
>            Reporter: Felix Meschberger
>             Fix For: 2.0.0
>
>         Attachments: SLING-64.patch
>
>
> microsling currently defines a SlingServlet interface which has a canProcess 
> method used to decide whether a servlet is capable of handling a request or 
> not. I think, this mechanism will not scale well if we add more script 
> engines or more servlets.
> As a first step towards a simpler approach, I propose the following:
>    * Merge the DefaultSlingServlet and the SlingPostServlet to a single 
> DefaultSlingServlet
>    * Replace Rhino and Velocity servlets by respective ScriptEngines (and 
> define the interface for that)
>    * Refactor the SlingScriptResolver such that after resolving the script, 
> it is also evaluated through a ScriptEngine
>    * Refactor MicroSlingServlet such, that
>              (1) check for a servlet by resource type
>              (2) try to evaluate a script
>              (3) fall back to the DefaultSlingServlet
>    * Also in the MicroSlingServlet register servlets by type (currently there 
> are none of course)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to