I agree with you that this would be a possible solution but a dirty one. Would it be a justified to implement this as a feature of the SlingServletResolver?
In this case I would fill a feature request and try to resolve this. Regards, Dirk -----Ursprüngliche Nachricht----- Von: Carsten Ziegeler [mailto:[email protected]] Gesendet: Dienstag, 10. Januar 2012 16:58 An: [email protected]; [email protected] Betreff: Re: Servlet Resoultion based only on a resource path Hi, I don't have a good answer either, but you could create a fake SlingHttpServletRequest object and invoke Servletresolver#resolveServlet(request). Regards Carsten 2012/1/5 Dirk Rudolph <[email protected]>: > Hi all, > > > > my task is to write a Servlet that should be used to get a list of all > components, their inheritance and how often they occur in the content tree. > > > > So the first issue wasnt a problem but now I have to search for all > nodes that are instances of one of the collected components. At first > I search my JCR repository using SQL and the sling:resourceType in the where clause. > Afterwards I want to resolve for each Node/Resource found by the query > the right Servlet because it is possible that one resourceType exists > twice like in this example: > > > > /apps/foundation/components/test => resourceType = > foundation/components/test > > /libs/foundation/components/test => resourceType = > foundation/components/test > > > > I also tried to use ServletResolver.resolveServlet(Resource, String) > but without success. For example I took the last part of the > resourceType as my script name: > > foundation/components/test => scriptName = test > > That worked for all components that are not inherited. But when I have > a component test2 that is inherit from test and doesnt contain a > test2.jsp this way doesnt work. > > > > So maybe anybody has an idea how I can resolve the Servlet used for a > given resource? > > > > Kindest Regards, > > > Dirk Rudolph > > > > T-Systems Multimedia Solutions GmbH > Organisationseinheit CCS > Dirk Rudolph > Software-Entwicklung/dualer Student > Hausanschrift: Riesaer Straße 5, 01129 Dresden > Postanschrift: Postfach 10 02 24, 01072 Dresden > +49 351 2820-5238 (Tel) > E-Mail: <mailto:[email protected]> > [email protected] > Internet: <http://www.t-systems-mms.de/> http://www.t-systems-mms.com > > T-Systems Multimedia Solutions GmbH > Aufsichtsrat: Ulrich Meister (Vorsitzender) > Geschäftsführung: Peter Klingenburg, Dr. Jens Nebendahl > Handelsregister: Amtsgericht Dresden HRB 11433 Sitz der Gesellschaft: > Dresden > Ust-IdNr.: DE 811 807 949 > > > > > > > -- Carsten Ziegeler [email protected]
