Dispatcher - how to handle/ configure etc/map internalRedirect in dispatcher.any? | Community
Skip to main content
New Participant
May 10, 2023
Question

Dispatcher - how to handle/ configure etc/map internalRedirect in dispatcher.any?

  • May 10, 2023
  • 0 replies
  • 418 views

Hello Experts,

 

I have written a sling resourcetype servlet which is pointing to - @SlingServletResourceTypes(resourceTypes = "MyProject/components/page", methods = HttpConstants.METHOD_POST, selectors = "pdfService", extensions = "html").

 

To make url simple and meaning full - i have created a mapping in /etc/map/http with internalRedirect with sling mapping something like this:

/etc/MyProject/jcr:content with localhost.4503/aemforms/print and final URL with resoureType servlet is - http://localhost:4503/aemforms/print.pdfService.html.

 

So far this works fine but when I try to access via dispatcher with URL - http://<dispatcherhost>/aemforms/print.pdfService.html. it does not work. And dispatcher.log at debug level do not have any info or error. 

 

Pls note If I hit dispatcher without internalRedirect URL like - http://<dispatcherhost>/etc/MyProject/jcr:content.pdfService.html then it works.

 

In dispatcher - /filter rules I have following for this publish instance is:

 

# AEM Forms Document Services API - whitelisting
/0088 { /type "allow" /url "/etc/MyProject/*" }
/0089 { /type "allow" /path "/etc/MyProject/*" /extension "html" /selectors "pdfService" }
/0090 { /type "allow" /url "/apps/MyProject/components/page" }
/0091 { /type "allow" /url "*/aemforms/print*" }
/0092 { /type "allow" /method "POST" /url "*/aemforms/print.pdfService.html" }

 

dispatcher.log:

[May 8 13:29:16 2023] [D] [pid 763491:tid 140023257040448] response.status = 200
[May 8 13:29:16 2023] [D] [pid 763491:tid 140023257040448] response.headers[Date] = "8 May 2023 17:29:16 GMT"
[May 8 13:29:16 2023] [D] [pid 763491:tid 140023257040448] response.headers[X-Content-Type-Options] = "nosniff"
[May 8 13:29:16 2023] [D] [pid 763491:tid 140023257040448] response.headers[Content-Type] = "text/html;charset=utf-8"
[May 8 13:29:16 2023] [D] [pid 763491:tid 140023257040448] No socket reuse: neither GET nor HEAD
[May 8 13:29:16 2023] [I] [pid 763491:tid 140023257040448] "POST /aemforms/print.pdfService.html" 200 none [publish/rend01] 7ms
[8/May/2023:13:29:16 -0400] "POST - HTTP/1.1" - - [-] 7ms

 

Pls guide what config is required on dispatcher.any for this URL to work from dispatcher.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.