/* ------------------------------------------------------------
354461
public RequestDispatcher getRequestDispatcher(String url)
    {
        if (url == null)
            return null;

        if (!url.startsWith("/"))
        {
            String relTo=URI.addPaths(_servletPath,_pathInfo);
            int slash=relTo.lastIndexOf("/");
            if (slash>1)
                relTo=relTo.substring(0,slash+1);
            else
                relTo="/";
            url=URI.addPaths(relTo,url);
        }
    
        return _servletHandler.getServletContext().getRequestDispatcher(url);
    }
394480
public void doProcess(HttpServletRequest req, HttpServletResponse res) 
		throws ServletException, IOException
	{
		PrintStream out = System.out;
		Properties properties = new Properties();
		String strTargetDirectory = this.getDestDirectory();
		
		String strReceiveMessage = gstrBlank;
		try	{
			MultipartRequest multi = new MultipartRequest(req, strTargetDirectory, MAX_SIZE);

			this.parseProperties(properties, multi);
			if (DEBUG)
				out.println();
			if (DEBUG)
				out.println("Files:");
			Enumeration<?> files = multi.getFileNames();
			while (files.hasMoreElements())
			{
				String name = (String)files.nextElement();
				String filename = multi.getFilesystemName(name);
				String type = multi.getContentType(name);
				File f = multi.getFile(name);
				if (DEBUG)
				{
					out.println("name: " + name);
					out.println("filename: " + filename);
					out.println("type: " + type);
					if (f != null) {
						out.println("f.toString(): " + f.toString());
						out.println("f.getName(): " + f.getName());
						out.println("f.exists(): " + f.exists());
						out.println("f.length(): " + f.length());
						out.println();
					}
				}

				if (f != null)
					strReceiveMessage += this.successfulFileUpload(f, properties);
			}
		} catch (IOException ex)	{
			String strError = ex.getMessage();
			if (strError.toLowerCase().indexOf("isn't multipart/form-data") != -1)
				strReceiveMessage = gstrBlank;	// Didn't specify a file (probably first time through)
			else
				strReceiveMessage = "<p>Previous upload not successful. Error: " + ex.getMessage() + "</p>" + RETURN;
		}
		this.sendForm(req, res, strReceiveMessage, properties);
	}
1312010
@Override
    public void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain filterChain) throws IOException, ServletException {
        ServletRequest request = servletRequest;
        ServletResponse response = servletResponse;
        int id = 0;

        // Generate the identifier if dumping is enabled for request and/or response
        if (LOG_REQUEST.isDebugEnabled() || LOG_RESPONSE.isDebugEnabled()) {
            id = counter.incrementAndGet();
        }

        // Dumping of the request is enabled so build the RequestWrapper and dump the request
        if (LOG_REQUEST.isDebugEnabled()) {
            request = new HttpServletRequestLoggingWrapper((HttpServletRequest) servletRequest, maxDumpSizeInKB);
            dumpRequest((HttpServletRequestLoggingWrapper) request, id);
        }

        if (LOG_RESPONSE.isDebugEnabled()) { // Dumping of the response is enabled so build the wrapper, handle the chain, dump the response, and write it to the outpuStream.
            response = new HttpServletResponseLoggingWrapper((HttpServletResponse) servletResponse, maxDumpSizeInKB);
            filterChain.doFilter(request, response);
            dumpResponse((HttpServletResponseLoggingWrapper) response, id);
        } else {
            // Dumping of the response is not needed so we just handle the chain
            filterChain.doFilter(request, response);
        }
    }
1242475
@Override
  protected void doPost(final HttpServletRequest req, final HttpServletResponse resp)
      throws ServletException, IOException {
    final Map<String, Object> ret = new HashMap<>();

    if (hasParam(req, ACTION_PARAM)) {
      final String action = getParam(req, ACTION_PARAM);
      if (action.equals(STATS_SET_REPORTINGINTERVAL)) {
        handleChangeMetricInterval(req, ret);
      } else if (action.equals(STATS_SET_CLEANINGINTERVAL)) {
        handleChangeCleaningInterval(req, ret);
      } else if (action.equals(STATS_SET_MAXREPORTERPOINTS)) {
        handleChangeEmitterPoints(req, ret);
      } else if (action.equals(STATS_GET_ALLMETRICSNAME)) {
        handleGetAllMMetricsName(req, ret);
      } else if (action.equals(STATS_GET_METRICHISTORY)) {
        handleGetMetricHistory(req, ret);
      } else if (action.equals(STATS_SET_ENABLEMETRICS)) {
        handleChangeManagerStatusRequest(req, ret, true);
      } else if (action.equals(STATS_SET_DISABLEMETRICS)) {
        handleChangeManagerStatusRequest(req, ret, false);
      } else {
        ret.put(RESPONSE_ERROR, "Invalid action");
      }
    }

    JSONUtils.toJSON(ret, resp.getOutputStream(), true);
  }
918945
public function process()
    {
        parent::process();

        if ($this->value === null) {
            return;
        }

        if ($this->value == '') {
            $this->value = null;
            return;
        }

        if (!$this->validateEmailAddress()) {
            $this->addMessage($this->getValidationMessage('email'));
        }
    }
1358314
@Override
    public void doGet(HttpServletRequest request, HttpServletResponse response)
            throws IOException, ServletException {

        String api = request.getParameter("api");

        if (api == null || api.length() == 0) {
            response.setContentType("text/html; charset=UTF-8");
            getIndex(response.getWriter());
        } else {
            response.setContentType("text/xml; charset=UTF-8");
            getWSDL(api.toUpperCase(), request.getRequestURL()
                            .toString(), response.getWriter());
        }

        response.flushBuffer();
    }
485647
private void _ws() throws
      IOException
  {
    builder.type = Type.S;
    // no need to preserve exact whitespace
    // but append an S char to keep the token
    // contract of always having a value
    builder.append(' ');
    reader.forward(NOT_WHITESPACE);

    if (debug)
    {
      int nxt = reader.peek();
      checkArgument(WHITESPACE.matches((char) reader.curChar));
      if (nxt > -1)
      {
        checkArgument(NOT_WHITESPACE.matches((char) nxt));
      }
    }
  }
51590
@Override
    public void setHeader(String name, String value) {
        this._getHttpServletResponse().setHeader(name, value);
    }
182907
public void doInitialKey()
    {
        FileListener nextListener = (FileListener)this.getNextEnabledListener();
        if (nextListener != null)
        {
            boolean bOldState = nextListener.setEnabledListener(false);  // Don't allow it to be called again
            nextListener.doInitialKey();
            nextListener.setEnabledListener(bOldState);
        }
        else if (this.getOwner() != null)
            this.getOwner().doInitialKey();
    }
847319
@Override
	final protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		resp.setBufferSize(BUFFER_SIZE);
		postCount.incrementAndGet();
		try {
			reportingDoPost(req, resp);
		} catch (ThreadDeath t) {
			throw t;
		} catch (RuntimeException | ServletException | IOException e) {
			getLogger().log(Level.SEVERE, null, e);
			throw e;
		} catch (SQLException t) {
			getLogger().log(Level.SEVERE, null, t);
			throw new ServletException(t);
		}
	}
435107
public function process()
    {
        parent::process();

        if ($this->value === null) {
            return;
        }

        $this->value = trim($this->value);

        if ($this->value == '') {
            $this->value = null;
            return;
        }

        if (!$this->validateUri($this->value)) {
            if (
                $this->validateUri($this->default_scheme . '://' . $this->value)
            ) {
                if ($this->scheme_required) {
                    $this->addMessage(
                        $this->getValidationMessage('scheme-required')
                    );
                } else {
                    $this->value = $this->default_scheme . '://' . $this->value;
                }
            } else {
                $this->addMessage($this->getValidationMessage('invalid-uri'));
            }
        }
    }
897726
private static void fillReqAndRes(ServletRequest req, ServletResponse res){
		//-- 填充请求和响应对象到ActionContext本地线程
		Request.init((HttpServletRequest)req);
		Response.init((HttpServletResponse)res);
	}
741400
@Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
            throws IOException, ServletException {
        HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse;

        // set cache directives
        httpServletResponse.setHeader(HTTPCacheHeader.CACHE_CONTROL.getName(), "no-cache, no-store");
        httpServletResponse.setDateHeader(HTTPCacheHeader.EXPIRES.getName(), 0L);

        filterChain.doFilter(servletRequest, servletResponse);
    }
1349210
@Override
    public void clear() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(tc, "Clearing this request: " + this);
        }
        super.clear();
        this.myMethod = MethodValues.UNDEF;
        this.myScheme = null;
        this.myURIBytes = SLASH;
        this.myURIString = null;
        this.myQueryBytes = null;
        this.queryParams = null;
        this.sUrlHost = null;
        this.sHdrHost = null;
        this.iUrlPort = HeaderStorage.NOTSET;
        this.iHdrPort = NOT_TESTED;
    }
159786
public function commit() : void
    {
        if (null === $this->is_valid) {
            $this->validate();
        }
        if ($this->is_valid && $this->user_value != null) {
            $this->default_value = $this->user_value;
        }
        $this->user_value = null;
        $this->is_valid = null;
        $this->is_changed = false;
    }
101193
@PostLoad
    @PostPersist
    @PostUpdate
    @PostRemove
    private void init() {
        if (this.internalPortletDefinitionId != -1
                && (this.portletDefinitionId == null
                        || this.portletDefinitionId.getLongId()
                                != this.internalPortletDefinitionId)) {
            this.portletDefinitionId =
                    PortletDefinitionIdImpl.create(this.internalPortletDefinitionId);
        }
    }
1170541
public void init()
    throws IOException
  {
    long now = CurrentTime.getExactTime();

    // server/0263
    // _nextRolloverCheckTime = now + _rolloverCheckPeriod;

    Path path = getPath();

    if (path != null) {
      Files.createDirectories(path.getParent());

      _rolloverPrefix = path.getName(path.getNameCount() - 1).toString();

      long lastModified = Files.getLastModifiedTime(path).toMillis();
      
      if (lastModified <= 0 || now < lastModified) {
        lastModified = now;
      }

      // _calendar.setGMTTime(lastModified);

      _nextPeriodEnd = nextRolloverTime(lastModified);
    }
    else {
      _nextPeriodEnd = nextRolloverTime(now);
    }
    
    if (_archiveFormat != null || getRolloverPeriod() <= 0) {
    }
    else if (_rolloverCron != null)
      _archiveFormat = _rolloverPrefix + ".%Y%m%d.%H";
    else if (getRolloverPeriod() % DAY == 0)
      _archiveFormat = _rolloverPrefix + ".%Y%m%d";
    else if (getRolloverPeriod() % HOUR == 0)
      _archiveFormat = _rolloverPrefix + ".%Y%m%d.%H";
    else
      _archiveFormat = _rolloverPrefix + ".%Y%m%d.%H%M";
    
    _isInit = true;

    _rolloverListener.requeue(_rolloverAlarm);
    rollover();
  }