Best way to customize resourceResolver behavior | Community
Skip to main content
Jun 13, 2017 3:00 PM UTC
Solved

Best way to customize resourceResolver behavior

Given an AEM 5.6.1 environment, what's the best way to use request headers to generate a resource path prefix?

For instance, suppose the locale is provided via httpRequest.getHeader("locale"), and our content is organized in the following tree:

en_US/homepage.html

ja_JP/homepage.html

How would you take a request for /homepage.html and internally prepend the locale retrieved from httpRequest.getHeader("locale")?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
MC_Stuff
MC_StuffAccepted solution
Level 10
Jun 14, 2017 3:14 AM UTC

Hi ofuangka,

   JCR resolver & mapping con't resolve at run time and configuration should exist prior. For your use case one of the option is to use apache rewrite rule. 

Thanks,

3 replies

MC_Stuff
MC_StuffAccepted solution
Level 10
Jun 14, 2017 3:14 AM UTC

Hi ofuangka,

   JCR resolver & mapping con't resolve at run time and configuration should exist prior. For your use case one of the option is to use apache rewrite rule. 

Thanks,

Translate
Jun 13, 2017 9:12 PM UTC

I didn't see anything there that uses HTTP request headers for mapping.  Did I miss something?

Translate
smacdonald2008
Level 10
Jun 13, 2017 5:58 PM UTC

Look at Sling Mapping -- Apache Sling - Mappings for Resource Resolution

Translate