Sling - Script resolution

vipink2884359 07-08-2018

Hi Team, While going through the sling script resolution, i came up with a point where i need some suggestion/clarification.

My URL :

http://localhost:4506/content/ideawebsite.men.abc.html , here selector is 'men.abc'

Node Name : ideapage

Script files under component ideapage are as below :

men.html.jsp

abc.html.jsp

men.abc.html.jsp

ideapage.jsp

On hit of above URL, men.html.jsp renders.

I want to invoke the file 'men.abc.html.jsp'

Can i have a file name like 'men.abc.html.jsp' (seems invalid to me), but if i want a best match with 'men.abc' + 'html' (Selector + Extension) + jsp, what should be the correct file name?

Thanks,

Vipin Kumar

Accepted Solutions (1)

Accepted Solutions (1)

Arun_Patidar
MVP
08-08-2018

Hi,

Yes, the file men.abc.html.jsp is not going to render anything.

if you want a match for men.abc it would be men.html.jsp. But if you really wanna render something based on 2 selectors then you need to create a file abc.html (selector2)inside men (selector1)folder.

e.g.

http://localhost:4502/content/AEM63App/en/products/2.men.abc.html?wcmmode=disabled

Screen Shot 2018-08-08 at 9.54.14 AM.png

Thanks

Arun

Answers (4)

Answers (4)

Gaurav_Tiwari_8 04-12-2018

Hi ,

You can watch the video here Sling Script Resolution - YouTube  In which I have tried explaining how to make use to different script and order of their resolution.

Also Please comment your valuable feedback.