简体   繁体   中英

AEM: How to register a non-Sling Servlet?

I have to register a "org.eclipse.jetty.servlets.ProxyServlet" in AEM.

This helps in having a better development environment, where my project uses external REST API for transactional piece of project.

But using sling annotation (@SlingServlet) I could not able to do it.

I would recommend writing a sling servlet (One that extends from SlingAllMethodsServlet or SlingSafeMethodsServlet depending on requirements) and delegate control to your ProxyServlet. As the SlingHttpServletRequest and SlingHttpServletResponse are basically HttpServletRequest and HttpServletResponse.

This would mean you do not have to tweak anything on the AEM to make your servlet work at the same time gives you an sling context in your wrapper in case you might need in future.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM