下面列出了javax.servlet.ServletException#initCause ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
/**
* {@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;
}
}
/**
* 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;
}
}
/**
* 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;
}
}