0

We have a requirement to implement the HttpServlet interface in webobjects application. We all know that "WebObjects applications can be deployed as servlets inside a servlet container".But, our requirement is to deploy the servlet application in webobjects server.

Please clarify me on the following.

  • Do we have servlet container inside our webobjects server?
  • Can we implement HttpServlet interface in webobjects applications?
Incredible
  • 3,495
  • 8
  • 49
  • 77

1 Answers1

0

WO itself doesn't include a Servlet container. As you noticed you rather run it itself as a Servlet within another container.

Of course you could implement a Servlet container in (the Servlet API on top of) WebObjects. You could either start out using a custom WORequestHandler or a WODirectAction. But that sounds really weird to me, maybe you should collect more information on why you want to do this. It probably makes more sense to run WO and the Servlet alongside in one container.

hnh
  • 13,957
  • 6
  • 30
  • 40
  • We would like to use servlet API in webobjects. Because we need to call third party api method with HttpServletRequest and HttpServletResponse as parameters. Now we are accepting the DirectAction request and we need to call that third party api. So we need to convert the WORequest to HttpServletRequest in DirectAction. But we don't want to deploy this application in other servers. We should have to deploy this only in webobjects. So please let me know, how to convert WORequest to HttpServletRequest or else the other choice. – Butchi Reddy Velagala May 29 '14 at 07:52
  • 1
    How you convert a WORequest to an HttpServletRequest? You simply sit down and code the conversion?! Copy headers, method, body as per the API. – hnh May 29 '14 at 10:14
  • Another option would be to host the Servlet in a regular container and just call it with an HTTP client from the DirectAction. This would be slower but probably way easier. – hnh May 29 '14 at 10:15