Re: Struts Plugin

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon May 16 2005 - 15:47:02 EDT

  • Next message: Doychi: "Re: Validation failures with Primary Key"

    Just put it on Wiki:

    http://objectstyle.org/confluence/display/CAY/Cayenne+Struts+PlugIn

    Thanks!
    Andrus

    > Our web applications are struts based and we are using the following
    > plugin.
    > We thought the community migh find it usefull...
    > Perhaps this could be added to the documentation? I did a saerch and
    > could
    > not find anythgin like it.
    >
    > package esolutions.struts;
    >
    > import javax.servlet.ServletException;
    >
    > import org.apache.commons.logging.Log;
    > import org.apache.commons.logging.LogFactory;
    > 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 {
    >
    > private static Log _log = LogFactory.getLog(CayennePlugin.class);
    >
    > /* (non-Javadoc)
    > *..ee org.apache.struts.action.PlugIn#destroy()
    > */
    > public void destroy() {
    > _log.debug( this.getClass().getName() + " : destroy() called!");
    > }
    >
    > /* (non-Javadoc)
    > *..ee org.apache.struts.action.PlugIn#init(
    > org.apache.struts.action.ActionServlet,
    > org.apache.struts.config.ModuleConfig)
    > */
    > public void init(ActionServlet servlet, ModuleConfig config) throws
    > ServletException {
    > _log.debug( this.getClass().getName() + " : Initializing Cayenne
    > configuration!");
    > BasicServletConfiguration.initializeConfiguration(servlet.getServletContext
    > ());
    > _log.debug( this.getClass().getName() + " : Completed Cayenne
    > configuration!");
    > }
    >
    > }
    > Here is what you would add to your struts-config.xml
    >
    > <plug-in className="esolutions.struts.CayennePlugin" />
    >
    >
    > --
    > Joshua T. Pyle
    > Go has always existed.



    This archive was generated by hypermail 2.0.0 : Mon May 16 2005 - 15:47:03 EDT