Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to set sling.servlet.resourceTypes in a Sling serlvet to a path relative to itself (to serlvet's resource)?
    primarykey
    data
    text
    <p>In case I have asked a question in a wrong way I will first say what I want to achieve:</p> <p>I have the following structure of a component in CQ5: /apps/TEST/components/DatabaseConnection (DatabaseConnection is a component name) /apps/TEST/components/DatabaseConnection/src/ServletDatabaseConnection (This is the my serlvet for processing POST requests from TEST/components/DatabaseConnection. </p> <p>In my servlet sling.servlet.resourceTypes is set to TEST/components/DatabaseConnection)</p> <p>So, I have set a relative path of sling.servlet.resourceTypes, and the serlvet will look for a resourceType under /apps/TEST/components/DatabaseConnection and under /libs/TEST/components/DatabaseConnection/</p> <p>But I want to be able to move my component DatabaseConnection to any other folder and not change anything neither in the servlet nor in the application. But if I do it now, I will have to change sling.servlet.resourceTypes to a new resourceType</p> <p>Taking into account, that everything in Sling is a resource, than my servlet is a resource too, right? So, probably it would be possible to set sling.servlet.resourceTypes relatively to the resourceType of the servlet?</p> <p>So, can I set sling.servlet.resourceTypes relatively to this servlet's resource type? If no, are there any other ways to make my component "moveable", so that I won't have to change anything in a servlet?</p> <p>I have found this two resources to be very useful: <a href="http://www.pro-vision.de/content/medialib/pro-vision/production/adaptto/2012/adaptto2012-apache-sling-basic-concepts-rainer-bartl-peter-manne/_jcr_content/renditions/rendition.file/adaptto2012-apache-sling-basic-concepts-rainer-bartl-peter-mannel.pdf" rel="nofollow">http://www.pro-vision.de/content/medialib/pro-vision/production/adaptto/2012/adaptto2012-apache-sling-basic-concepts-rainer-bartl-peter-manne/_jcr_content/renditions/rendition.file/adaptto2012-apache-sling-basic-concepts-rainer-bartl-peter-mannel.pdf</a> <a href="http://sling.apache.org/site/resources.html" rel="nofollow">http://sling.apache.org/site/resources.html</a> But I still can't come up with a solution</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload