Apache Cayenne > Index > Cayenne Examples > Cayenne Struts PlugIn

To use this Struts PlugIn put this entry in struts-config.xml:

  
<plug-in className="mypackage.CayennePlugin" />

Here is the plugin code:

Struts PlugIn
package mypackage;
import javax.servlet.ServletException;

import org.apache.struts.action.ActionServlet;
import org.apache.struts.action.PlugIn;
import org.apache.struts.config.ModuleConfig;
import org.objectstyle.cayenne.conf.BasicServletConfiguration;

public class CayennePlugin implements PlugIn {

   public void destroy() {
       
   }

   public void init(ActionServlet servlet, ModuleConfig config) throws ServletException {
      BasicServletConfiguration.initializeConfiguration(servlet.getServletContext());
   }
}