Hi,
tung vu duc schrieb:
>> Depends on what a "normal" webapp is. Lots of Sling use cases don't
>> require any OSGi knowledge, you can go a long way just with scripting
>> in the repository. What kind of server-side web framework would you
>> use with Sling? You don't need any, unless I misunderstand the term.
>
>> And quite frankly, creating pluggable Sling servlets or components is
>> not that hard using the supplied Maven plugins. And there are other
>> ways that are not hard if you don't want to use Maven.
>
> Ok, i use Grails for my webapp, Grails internal uses Spring MVC. Grails
> supports other technologies via it's plugin mechanism.
> Plugin in Grails means defining the servlets, servlet-filters and so of other
> Technology in the web.xml of Grails webapp.
>
> So, which module of whole sling should i build now ? which servlets, filters
> and so of sling should be defined in Grails web.xml
> (only org.apache.sling.launcher.webapp.SlingServlet? ). The dependencies
> .jars of Sling are bundled as OSGi-bundles, that means,
> that Felix muss be started with when i launch my webapp. is there somethings
> to note?
As you may not the Felix Launchpad Web Application, is in effect just a
single Servlet, the SlingServlet. This is default to handle all requests
and does the following:
* init(): Launches The Felix framework and installs all Sling
Bundles into the framework (if launching the first time)
* service(): Forwards to the SlingMainServlet, which is part
of the Sling Engine bundle and which then uses the rest
of Sling to select a script/servlet to handle the request
* destroy(): Shuts down the Felix framework
So to integrate this into your web application, you just add the
SlingServlet (and its accompanying classes) and register the servlet in
the web application.
It may be possible to register the SlingServlet (and its required other
parts) into a Spring MVC. But we didn't test this (yet).
If you happen to succeed in this, we would be very gratefull for
documentation on the steps you did to achieve this !
Regards
Felix