You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

ServletListener Component

Available as of Camel 2.11

This component is used for bootstrapping Camel applications in web applications. For example beforehand people would have to find their own way of bootstrapping Camel, or rely on 3rd party frameworks such as Spring to do it.

There may be situations where you want a pure Camel based solution, without the extra overhead of Spring Framework.

Sidebar

This component works as a javax.servlet.ServletContextListener, which works in any web container of today, as well any older containers.
There may be solutions around the corner which is based on Servlet 3.x and annotation driven configuration, or using CDI or other means.
This component is old school and based on the pure API from Servlet 2.x, which means it works in any web container. Also the old ones, which was the goal.

TODO: Maven dependency

Using

To use this you need to configure the org.apache.camel.component.servletlistener.CamelServletContextListener in the WEB-INF/web.xml file as shown below:
TODO: myweb.xml

Example

See Servlet Tomcat No Spring Example.

Options

The org.apache.camel.component.servletlistener.CamelServletContextListener supports the following options which can be configured as context-param in the web.xml file.

Option

Description

propertyPlaceholder.XXX

To configure Using PropertyPlaceholder in Camel. You should prefix the option with "propertyPlaceholder.", for example to configure the location, use propertyPlaceholder.location as name. You can configure all the options from the Properties component.

See Also

  • No labels