Class Butterfly

  • All Implemented Interfaces:
    Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

    public class Butterfly
    extends javax.servlet.http.HttpServlet
    This is the Butterfly servlet and the main entry point for a Butterfly-powered web application. This servlet is responsible for loading, configuring and wire together the various modules that compose your webapp and then manages the dispatching of requests to the modules that are supposed to handle them.
    See Also:
    Serialized Form
    • Constructor Detail

      • Butterfly

        public Butterfly()
    • Method Detail

      • getTrueHost

        public static String getTrueHost​(javax.servlet.http.HttpServletRequest request)
      • getTrueContextPath

        public static String getTrueContextPath​(javax.servlet.http.HttpServletRequest request,
                                                boolean absolute)
      • getTrueRequestURI

        public static String getTrueRequestURI​(javax.servlet.http.HttpServletRequest request,
                                               boolean absolute)
      • getFullHost

        public static String getFullHost​(javax.servlet.http.HttpServletRequest request)
      • isGAE

        public static boolean isGAE​(javax.servlet.ServletConfig config)
      • init

        public void init​(javax.servlet.ServletConfig config)
                  throws javax.servlet.ServletException
        Specified by:
        init in interface javax.servlet.Servlet
        Overrides:
        init in class javax.servlet.GenericServlet
        Throws:
        javax.servlet.ServletException
      • destroy

        public void destroy()
        Specified by:
        destroy in interface javax.servlet.Servlet
        Overrides:
        destroy in class javax.servlet.GenericServlet
      • configure

        public void configure()
      • initializeModule

        protected void initializeModule​(String name,
                                        Set<String> initialized,
                                        Set<String> initializing)
      • service

        public void service​(javax.servlet.http.HttpServletRequest request,
                            javax.servlet.http.HttpServletResponse response)
                     throws javax.servlet.ServletException,
                            IOException
        Overrides:
        service in class javax.servlet.http.HttpServlet
        Throws:
        javax.servlet.ServletException
        IOException
      • setRoutingCookie

        protected void setRoutingCookie​(javax.servlet.http.HttpServletRequest request,
                                        javax.servlet.http.HttpServletResponse response)
      • absolutize

        protected File absolutize​(File base,
                                  String location)
      • findModulesIn

        protected void findModulesIn​(File f)
      • wireModules

        protected void wireModules​(org.apache.commons.collections.ExtendedProperties wirings)
      • configureModules

        protected void configureModules()
      • setScript

        protected static void setScript​(ButterflyModule mod,
                                        URL location,
                                        org.mozilla.javascript.Script script)