javax.servlet.ServletException#initCause ( )源码实例Demo

下面列出了javax.servlet.ServletException#initCause ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: sakai   文件: UploadFilter.java
public void init(FilterConfig config) throws ServletException {
	repositoryPath = config
			.getInitParameter("com.corejsf.UploadFilter.repositoryPath");
	try {
		String paramValue = config
				.getInitParameter("com.corejsf.UploadFilter.sizeThreshold");
		if (paramValue != null)
			sizeThreshold = Integer.parseInt(paramValue);
		paramValue = config.getInitParameter("com.corejsf.UploadFilter.sizeMax");
		if (paramValue != null)
			sizeMax = Long.parseLong(paramValue);
	} catch (NumberFormatException ex) {
		ServletException servletEx = new ServletException();
		servletEx.initCause(ex);
		throw servletEx;
	}
}
 
源代码2 项目: sakai   文件: FileUploadFilter.java
public void init(FilterConfig config) throws ServletException {
    repositoryPath = config.getInitParameter("org.sakaiproject.tool.messageforums.FileUploadFilter.repositoryPath");

    try {
        String paramValue = config.getInitParameter("org.sakaiproject.tool.messageforums.FileUploadFilter.sizeThreshold");

        if (paramValue != null) {
            sizeThreshold = Integer.parseInt(paramValue);
        }
        paramValue = config.getInitParameter("org.sakaiproject.tool.messageforums.FileUploadFilter.sizeMax");
        if (paramValue != null) {
            sizeMax = Long.parseLong(paramValue);
        }
    } catch (NumberFormatException ex) {
        ServletException servletEx = new ServletException();
        servletEx.initCause(ex);
        throw servletEx;
    }
}
 
源代码3 项目: sakai   文件: FileUploadFilter.java
public void init(FilterConfig config) throws ServletException 
{
  repositoryPath = config.getInitParameter("org.sakaiproject.tool.syllabus.FileUploadFilter.repositoryPath");
  
  try 
  {
    String paramValue = config.getInitParameter("org.sakaiproject.tool.syllabus.FileUploadFilter.sizeThreshold");

    if (paramValue != null) 
      sizeThreshold = Integer.parseInt(paramValue);
    paramValue = config.getInitParameter("org.sakaiproject.tool.syllabus.FileUploadFilter.sizeMax");
    if (paramValue != null) 
      sizeMax = Long.parseLong(paramValue);
  }
  catch (NumberFormatException ex) 
  {
    ServletException servletEx = new ServletException();
    servletEx.initCause(ex);
    throw servletEx;
  }
}
 
源代码4 项目: sakai   文件: UploadFilter.java
public void init(FilterConfig config) throws ServletException {
	repositoryPath = config
			.getInitParameter("com.corejsf.UploadFilter.repositoryPath");
	try {
		String paramValue = config
				.getInitParameter("com.corejsf.UploadFilter.sizeThreshold");
		if (paramValue != null)
			sizeThreshold = Integer.parseInt(paramValue);
		paramValue = config.getInitParameter("com.corejsf.UploadFilter.sizeMax");
		if (paramValue != null)
			sizeMax = Long.parseLong(paramValue);
	} catch (NumberFormatException ex) {
		ServletException servletEx = new ServletException();
		servletEx.initCause(ex);
		throw servletEx;
	}
}
 
源代码5 项目: sakai   文件: FileUploadFilter.java
public void init(FilterConfig config) throws ServletException {
    repositoryPath = config.getInitParameter("org.sakaiproject.tool.messageforums.FileUploadFilter.repositoryPath");

    try {
        String paramValue = config.getInitParameter("org.sakaiproject.tool.messageforums.FileUploadFilter.sizeThreshold");

        if (paramValue != null) {
            sizeThreshold = Integer.parseInt(paramValue);
        }
        paramValue = config.getInitParameter("org.sakaiproject.tool.messageforums.FileUploadFilter.sizeMax");
        if (paramValue != null) {
            sizeMax = Long.parseLong(paramValue);
        }
    } catch (NumberFormatException ex) {
        ServletException servletEx = new ServletException();
        servletEx.initCause(ex);
        throw servletEx;
    }
}
 
源代码6 项目: sakai   文件: FileUploadFilter.java
public void init(FilterConfig config) throws ServletException 
{
  repositoryPath = config.getInitParameter("org.sakaiproject.tool.syllabus.FileUploadFilter.repositoryPath");
  
  try 
  {
    String paramValue = config.getInitParameter("org.sakaiproject.tool.syllabus.FileUploadFilter.sizeThreshold");

    if (paramValue != null) 
      sizeThreshold = Integer.parseInt(paramValue);
    paramValue = config.getInitParameter("org.sakaiproject.tool.syllabus.FileUploadFilter.sizeMax");
    if (paramValue != null) 
      sizeMax = Long.parseLong(paramValue);
  }
  catch (NumberFormatException ex) 
  {
    ServletException servletEx = new ServletException();
    servletEx.initCause(ex);
    throw servletEx;
  }
}
 
源代码7 项目: lutece-core   文件: DosGuardFilter.java
/**
 * {@inheritDoc}
 */
@Override
public void init( FilterConfig config ) throws ServletException
{
    _mapLastRequestTimes = new HashMap<>( INITIAL_CAPACITY );
    _listOrderedRequests = new LinkedList<>( );

    try
    {
        String paramValue = config.getInitParameter( "minContentLength" );

        if ( paramValue != null )
        {
            _nMinContentLength = Integer.parseInt( paramValue );
        }

        paramValue = config.getInitParameter( "minInterval" );

        if ( paramValue != null )
        {
            _nMinInterval = Integer.parseInt( paramValue );
        }
    }
    catch( NumberFormatException ex )
    {
        ServletException servletEx = new ServletException( ex.getMessage( ) );
        servletEx.initCause( ex );
        throw servletEx;
    }
}
 
源代码8 项目: uyuni   文件: XmlRpcServlet.java
/**
 * executed when a post request happens
 *
 * @param request the request object
 * @param response the response object
 * @throws ServletException if a read error occurs
 * @throws IOException if a read error occurs
 */
public void doPost(HttpServletRequest request,
                   HttpServletResponse response)
    throws ServletException, IOException {

    if (log.isDebugEnabled()) {
        log.debug("Entered doPost");
    }

    if (request.getHeader("SOAPAction") != null) {
        passControl(request, response);
        return;
    }

    response.setContentType("text/xml");
    try {
        if (log.isDebugEnabled()) {
            log.debug("Passing control to XmlRpcServer.execute");
        }

        server.execute(request.getInputStream(),
                       response.getWriter(),
                       request.getRemoteAddr(),
                       request.getLocalName(),
                       request.getProtocol());

        /*
         * jesusr - 2007.09.14
         * this is still the case
         *
         * mbowman - 2005.10.06
         * Like we were raised in a barn, we are going to leave here without
         * flushing ;)
         * -- The current thinking is that Tocmat handles the outputStream
         * -- flushing and closing for us. This make sense since after this
         * -- method runs, the response still needs to go back up through
         * -- the filters and out. If things start breaking in the future,
         * -- this is a  good place to start looking.
         */
    }
    // As bad as this is, we have no choice, Marquee-xmlrpc throws
    // Throwable, so we have to catch it.
    catch (Throwable t) {
        // By the time we get here, it can't be a FaultException, so just
        // wrap it in a ServletException and toss.
        ServletException e = new ServletException("Throwable from XmlRpc", t);
        t.printStackTrace();
        if (e.getCause() != t) {
            e.initCause(t);
        }
        throw e;
    }
}
 
源代码9 项目: spacewalk   文件: XmlRpcServlet.java
/**
 * executed when a post request happens
 *
 * @param request the request object
 * @param response the response object
 * @throws ServletException if a read error occurs
 * @throws IOException if a read error occurs
 */
public void doPost(HttpServletRequest request,
                   HttpServletResponse response)
    throws ServletException, IOException {

    if (log.isDebugEnabled()) {
        log.debug("Entered doPost");
    }

    if (request.getHeader("SOAPAction") != null) {
        passControl(request, response);
        return;
    }

    response.setContentType("text/xml");
    try {
        if (log.isDebugEnabled()) {
            log.debug("Passing control to XmlRpcServer.execute");
        }

        server.execute(request.getInputStream(),
                       response.getWriter(),
                       request.getRemoteAddr(),
                       request.getLocalName(),
                       request.getProtocol());

        /*
         * jesusr - 2007.09.14
         * this is still the case
         *
         * mbowman - 2005.10.06
         * Like we were raised in a barn, we are going to leave here without
         * flushing ;)
         * -- The current thinking is that Tocmat handles the outputStream
         * -- flushing and closing for us. This make sense since after this
         * -- method runs, the response still needs to go back up through
         * -- the filters and out. If things start breaking in the future,
         * -- this is a  good place to start looking.
         */
    }
    // As bad as this is, we have no choice, Marquee-xmlrpc throws
    // Throwable, so we have to catch it.
    catch (Throwable t) {
        // By the time we get here, it can't be a FaultException, so just
        // wrap it in a ServletException and toss.
        ServletException e = new ServletException("Throwable from XmlRpc", t);
        t.printStackTrace();
        if (e.getCause() != t) {
            e.initCause(t);
        }
        throw e;
    }
}