[OT] are tomcat and jetty simply alternative java servlet engines?

Carlos A. Carnero Delgado carloscarnero at gmail.com
Fri Jun 25 03:26:48 UTC 2010

>   that's about what i thought -- it means that if someone presents an
>  app that requires a java servlet engine, it's possible they'll have
>  three different versions of that app -- one each for jboss, tomcat and
>  jetty, is that correct?
>   or let me ask that another way -- when you build such an app, does
>  it have to know which java servlet engine you'll be running it
>  against?  thanks.

If the application is built and packaged according to the Servlet
specs, then it is possible to deploy it anywhere. Only if it uses a
service or facility that one container provides but the other does
not, you'll run into problems.

For instance, JTA is not guaranteed to be available in these servlet
containers, so people often use a third party implementation and
package it with the application instead of relying on the existence
(or not) of JTA across every servlet container.

If you can, try to adhere as strictly as possible to the servlet
specification when developing the application. Then pay close
attention to the version of the spec it was developed against,
choosing the servlet containers that implement those versions. You
won't have many problems, IMO.


More information about the ubuntu-users mailing list