Hello ,
I am currently facing a strange behavior on dispatcher publish URL
1>When i hit the servlet path from JavaScript say /bin/servletpath , I get 200 status response from servlet
2>Now 2nd time when I hit the same path using JavaScript say /bin/servletpath, it does not hit the servlet .Instead the server sends 302 as status response.
What could I do to resolve this issue. Not sure where to look into for this??
Regards,
Srinivas
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @Srinivas_Opti,
It might be possible that the servlet response is getting cached. Make sure you exclude the same path from getting cached by doing changes in the dispatcher.any file.
Also, the 302 status means redirection. If there is any authentication or session timeout logic is written in your code make sure it is correct.
Other debugging options:
-- Try to hit your servlet using postman so that we can be sure JS is not responsible.
-- Set some loggers in your servlet and share there outputs here.
-- Use the browser's network tab to inspect headers and responses for both the first (200) and second (302) requests. This will help you identify if there’s a redirect URL in the second request.
Also, please share if this issue also occur on local publish instance?
Hi @Srinivas_Opti
Using path-based servlets is not recommended. Instead, use servlets registered by resource type with selectors and extensions. Expose these servlets to the content path and access them using content path, selector, and extension for better maintainability and performance.
Hi,
Is this AEM on-premise? It sounds like your publishers may be out of sync. Verify that your publishers have installed the same code and content, and then make sure there is no cache issue.
Hope this helps.
Hi @Srinivas_Opti,
It might be possible that the servlet response is getting cached. Make sure you exclude the same path from getting cached by doing changes in the dispatcher.any file.
Also, the 302 status means redirection. If there is any authentication or session timeout logic is written in your code make sure it is correct.
Other debugging options:
-- Try to hit your servlet using postman so that we can be sure JS is not responsible.
-- Set some loggers in your servlet and share there outputs here.
-- Use the browser's network tab to inspect headers and responses for both the first (200) and second (302) requests. This will help you identify if there’s a redirect URL in the second request.
Also, please share if this issue also occur on local publish instance?
@Srinivas_Opti Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies