Expand my Community achievements bar.

SOLVED

Post/Get servlet with selector throwing error in dispatcher

Avatar

Level 7

On Dispatcher POST/GET call with Selector is giving error but without selector it is working fine. But I want it to work with selector. I have allowed selector in filter still it is not working. This issue appeared after the shortening of the URL. Without shortening it was working fine.

 

My servlet is resource type binded with component

http://dev.sample.com/en-us/bloglisting/blog/jcr:content/root/responsivegrid/imagedownloader.downloa...

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

If the URL works on postman means your Page is cached, try flushing dispatcher cache and then try on incognito window 



Esteban Bustamante

View solution in original post

8 Replies

Avatar

Community Advisor

Hello @Ronnie09 

Can you please put some sample URL and more details?

 

Avatar

Community Advisor

Hi @Ronnie09 

 

Can you share the error that you are seeing?

 

Also If you don't define extensions but define selectors, your selectors can be used with extensions which means you can call only with selector(/content/my-site/en.testing). But it is not recommended. Define both selectors and extensions.

 

Hope it helps!

Thanks,
Kiran Vedantam.

Avatar

Level 7

@Kiran_Vedantam 

Through postman it is working fine now with selector and extension but on PAGE it is showing 301 redirect and converting POST call to GET 

Which gives response header location as 404 page path

Avatar

Community Advisor

Which error are you getting? is it 40X? If so, it is clearly a dispatcher config issue, I think you have answered your own question, check the following:

1. The servlet is allowed (GET/POST) to the selector you are attempting to hit in the dispatcher filter configs

2. The rewrite rule is such, that you can get the full URL which will be understood by the publisher

3. Restart Apache to apply your changes.

 

For more details, you should set your dispatcher log's level to DEBUG and check what URL it is being hit, whit that info you will clearly see, if is it a correct (valid) URL that will be understood by the publisher. Is it being blocked? 



Esteban Bustamante

Avatar

Community Advisor

Hello @Ronnie09 

 

1. Please use an extension while accessing the resource.

- That provides a better understanding of the response type 

- Selector would not be confused as extension

 

2. Please check the AEM publish logs and dispatcher logs. It will help you understand what request is hitting the publish server:

- Is any request hitting AEM publish?

- If yes, whats the URL? 

- Does the URL give the expected results when accessed on publish directly?

 


Aanchal Sikka

Avatar

Level 7

Hi @aanchal-sikka 
It is working now via postman but on Dispatcher URL first it is hitting full path of the servlet then its hitting shortened URL 2 calls are happening in total and giving 404 ... Same URL works on POSTMAN. 

Avatar

Correct answer by
Community Advisor

If the URL works on postman means your Page is cached, try flushing dispatcher cache and then try on incognito window 



Esteban Bustamante