Re: combine jsp processing in sling with jsp processing in servlet container?
On Fri, Jul 4, 2008 at 1:22 AM, Torgeir Veimo [EMAIL PROTECTED] wrote: ...What's the easiest way to enable the servlet container to retain processing requests which are not handeled by the sling servlet? ... The launchpad/webapp web.xml contains this: !-- Overwrite Mappings which may be present in default web.xml files -- servlet-mapping servlet-namesling/servlet-name url-pattern*.jsp/url-pattern /servlet-mapping So maybe removing it would do the trick? -Bertrand
Re: combine jsp processing in sling with jsp processing in servlet container?
On 4 Jul 2008, at 17:25, Bertrand Delacretaz wrote: The launchpad/webapp web.xml contains this: !-- Overwrite Mappings which may be present in default web.xml files -- servlet-mapping servlet-namesling/servlet-name url-pattern*.jsp/url-pattern /servlet-mapping So maybe removing it would do the trick? Do the sling servlet handle JSPs residing both in the file system and the repository? -- Torgeir Veimo [EMAIL PROTECTED]
Re: combine jsp processing in sling with jsp processing in servlet container?
On Fri, Jul 4, 2008 at 9:30 AM, Torgeir Veimo [EMAIL PROTECTED] wrote: ...Do the sling servlet handle JSPs residing both in the file system and the repository?... No, all Sling script engines look for scripts in the repository only. To change this you'd have to modify or replace the SlingServletResolver class. -Bertrand
Re: combine jsp processing in sling with jsp processing in servlet container?
Hi, Bertrand Delacretaz schrieb: On Fri, Jul 4, 2008 at 11:13 AM, Torgeir Veimo [EMAIL PROTECTED] wrote: ...It would be handy if the servlet containers JSP servlet could resume processing if a URL was not handled by the sling servlet If you request a .jsp resource that is not in the repository, the Sling resource resolver will select an o.a.s.api.resource.NonExistingResource, with a resource type of sling:nonexisting. To be precise we operate in the Resource tree. This in an extended repository. So, not all JSPs are required to be present in the JCR repository. You may also provide JSPs in bundles. So, if you for example pack your existing JSP files into a bundle and define Sling-Bundle-Resources manifest headers, you can use them directly. Alternatively you may create a ResourceProvider providing JSP file resources from the filesystem. You might take a look at the BundleResourceProvider for a hint on how to do this. Regards Felix This means you could create a servlet to handle this resource type (@scr.property name=sling.servlet.resourceTypes value=sling:nonexisting), which could then forward to the servlet container as needed. To experiment with this, you can also create a apps/sling/nonexisting/nonexisting.esp script in the repository. -Bertrand
Re: combine jsp processing in sling with jsp processing in servlet container?
Hi, Bertrand Delacretaz schrieb: On Fri, Jul 4, 2008 at 1:22 AM, Torgeir Veimo [EMAIL PROTECTED] wrote: ...What's the easiest way to enable the servlet container to retain processing requests which are not handeled by the sling servlet? ... The launchpad/webapp web.xml contains this: !-- Overwrite Mappings which may be present in default web.xml files -- servlet-mapping servlet-namesling/servlet-name url-pattern*.jsp/url-pattern /servlet-mapping So maybe removing it would do the trick? Not necessairily, because we still have the mapping for the root: servlet-mapping servlet-namesling/servlet-name url-pattern/*/url-pattern /servlet-mapping In addition requests to be handled by JSPs inside Sling are not generally called with the .jsp extension. So to have the servlet container handle requests for *.jsp, you would have to define a servlet which handles these requests, e.g. servlet display-nameJSP Servlet/display-name servlet-namejsp/servlet-name servlet-class ..fully qualified name of JSP servlet /servlet-class /servlet servlet-mapping servlet-namejsp/servlet-name url-pattern*.jsp/url-pattern /servlet-mapping Hope this helps. Regards Felix
combine jsp processing in sling with jsp processing in servlet container?
Sling seems to take over all JSP page processing, so JSP pages now have to remain in the repository? What's the easiest way to enable the servlet container to retain processing requests which are not handeled by the sling servlet? I know it's technically possible to do programmatically with tomcat using RequestDispatcher disp = request.getSession().getServletContext().getNamedDispatcher(default); disp.forward(request, response); but it would be nice if this could be done using simple configuration. Would be very handy when integrating sling into an existing web application which needs to retain JSP processing by the servlet container. -- Torgeir Veimo [EMAIL PROTECTED]