Deploying cocoon on Application Servers

  • TARGET-AUDIENCE: beginners
  • COCOON-RELEASES: 2.0.3, 2.0.4
  • DOCUMENT-STATUS: *draft* reviewed released

Deploying Cocoon on an application server is a fairly straight forward task. The main thing to keep in mind is that Cocoon is, at its core, just a servlet. With that in mind, deploying on your application server is just the same as deploying any other servlet. For JBoss 3.0+ it's a simple matter of dropping the war in the correct deploy directory.

_Is the following text really at the right place here?
These remarks are relevant AFTER installation, not FOR installation – Hussayn_

Some things you will want to keep in mind as you do development on Cocoon in an application server context.

  • Unlike writing JSP, which are compiled into servlets, XSP pages are interpreted and compiled into generators. These are special cocoon extensions that allow you to create custom documents dynamically. Since these generators are not independent servlets but just extensions to cocoon, they do not require you to modify the web.xml file. Once you add them appropriately to your sitemap, it will all work magically.
  • You should hardly ever have to modify the WEB-INF files. Remember, you will be adding to Cocoon, not adding new servlets. You should only edit the files in the WEB-INF directory if you really know what you are doing.
  • Once you deploy cocoon to your application server, you should have access to all of the JNDI properties in your custom generators or XSP pages. Getting an initial context is identical to the manner you would normally use for your application server. For JBoss 3.0+, for example, you merely need to call. InitialContext ictxt = new InitialContext();
  • Beware when adding any env-entry or ejb-ref elements or other elements to the web.xml. Although it shouldn't be a problem, make sure you understand the file completely and don't delete anything critical to cocoon.
  • If you edit the xconf files, you should be advanced enough that all of the information in this tutorial should be trivial to you. Just copy them over in place and leave them alone for the most part.

page metadata

  • AUTHOR: Robert Simmons
  • AUTHOR-CONTACT:BR
  • REVIEWED-BY:BR
  • REVIEWER-CONTACT:BR
  • No labels