Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

SLING REQUEST URL

Avatar

Level 3

what is the use of a suffix in a sling request URL? 

 

https://example.com/myhomepage.hp.html/a/b?id=1

 

In the URL above what is the use of /a/b ? 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Prashanth_02a,

Suffix usually used to provide additional information to your servlet/JSP page. Just check editor interface in TouchUI: the url looks like

http://localhost:4502/editor.html/content/pageYouEdit.html

So you always stays on the same page /editor.html, but suffix notifies Edit Interface which page to edit. 

Reference: Here is the best example between selector and suffix has been answered - https://stackoverflow.com/questions/41345775/what-is-the-use-of-suffix-in-sling-urls

 

Best way to use suffix in AEM URLs

It is better to use the suffix with selectors only that will help the dispatcher when flush cache.
Eg:-
<resource path>/results.html

<resource path>/results.html/suffix (Not recommended )

<resource path>/results.html/suffix.suffix1 (Not recommended )

<resource path>/results.slelector.html/suffix (Recommended)

<resource path>/results.slelector.html/suffix.suffix1 (Recommended)
 
Hope that helps!
Regards,
Santosh

View solution in original post

2 Replies

Avatar

Community Advisor

It depends on use case,

for example page editor use this to identify the page to be edited

http://localhost:1450/editor.html/content/myapp/us.html

 

 

Avatar

Correct answer by
Community Advisor

Hi @Prashanth_02a,

Suffix usually used to provide additional information to your servlet/JSP page. Just check editor interface in TouchUI: the url looks like

http://localhost:4502/editor.html/content/pageYouEdit.html

So you always stays on the same page /editor.html, but suffix notifies Edit Interface which page to edit. 

Reference: Here is the best example between selector and suffix has been answered - https://stackoverflow.com/questions/41345775/what-is-the-use-of-suffix-in-sling-urls

 

Best way to use suffix in AEM URLs

It is better to use the suffix with selectors only that will help the dispatcher when flush cache.
Eg:-
<resource path>/results.html

<resource path>/results.html/suffix (Not recommended )

<resource path>/results.html/suffix.suffix1 (Not recommended )

<resource path>/results.slelector.html/suffix (Recommended)

<resource path>/results.slelector.html/suffix.suffix1 (Recommended)
 
Hope that helps!
Regards,
Santosh