pekko/akka-docs/pending/servlet.rst
2011-04-09 19:55:46 -06:00

41 lines
1.3 KiB
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Akka Servlet
============
=
Module stability: **STABLE**
Akka has a servlet; se.scalablesolutions.akka.comet.AkkaServlet that can use to deploy your Akka-based application in an external Servlet container. All you need to do is to add the servlet to the web.xml, set $AKKA_HOME to the root of the distribution (needs the $AKKA_HOME/config/* files) and add the JARs in the $AKKA_HOME/lib to your classpath (or put them in the WEB-INF/lib directory in the WAR file).
Also, you need to add the Akka initialize/cleanup listener in web.xml
.. code-block:: xml
<web-app>
...
<listener>
<listener-class>se.scalablesolutions.akka.servlet.Initializer</listener-class>
</listener>
...
</web-app>
And to support REST actors and/or comet actors, you need to add the following servlet declaration:
`<code format="xml">`_
<web-app>
...
<servlet>
<servlet-name>Akka</servlet-name>
<!-- Both Comet + REST -->
<servlet-class>se.scalablesolutions.akka.comet.AkkaServlet</servlet-class>
<!-- Or if you don't want to use comet, but only REST -->
<servlet-class>se.scalablesolutions.akka.rest.AkkaServlet</servlet-class>
</servlet>
<servlet-mapping>
<url-pattern>*</url-pattern>
<servlet-name>Akka</servlet-name>
</servlet-mapping>
...
</web-app>
`<code>`_