예제 #1
0
 private Reconfigurable GetReconfigurable(HttpServletRequest req)
 {
     Log.Info("servlet path: " + req.GetServletPath());
     Log.Info("getting attribute: " + ConfServletReconfigurablePrefix + req.GetServletPath
                  ());
     return((Reconfigurable)this.GetServletContext().GetAttribute(ConfServletReconfigurablePrefix
                                                                  + req.GetServletPath()));
 }
예제 #2
0
        /// <exception cref="Javax.Servlet.ServletException"/>
        /// <exception cref="System.IO.IOException"/>
        protected override void DoPost(HttpServletRequest req, HttpServletResponse resp)
        {
            Log.Info("POST");
            resp.SetContentType("text/html");
            PrintWriter    @out     = resp.GetWriter();
            Reconfigurable reconf   = GetReconfigurable(req);
            string         nodeName = reconf.GetType().GetCanonicalName();

            PrintHeader(@out, nodeName);
            try
            {
                ApplyChanges(@out, reconf, req);
            }
            catch (ReconfigurationException e)
            {
                resp.SendError(HttpServletResponse.ScInternalServerError, StringUtils.StringifyException
                                   (e));
                return;
            }
            @out.WriteLine("<p><a href=\"" + req.GetServletPath() + "\">back</a></p>");
            PrintFooter(@out);
        }