本文整理汇总了Java中org.mortbay.jetty.HttpException类的典型用法代码示例。如果您正苦于以下问题:Java HttpException类的具体用法?Java HttpException怎么用?Java HttpException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HttpException类属于org.mortbay.jetty包,在下文中一共展示了HttpException类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleRequest
import org.mortbay.jetty.HttpException; //导入依赖的package包/类
protected void handleRequest() throws IOException
{
try
{
String info = URIUtil.canonicalPath(super._uri.getDecodedPath());
if (info==null) throw new HttpException(400);
info = info.substring(this.virtualContextPath.length());
super._request.setPathInfo(info);
HttpServletRequest request = super._request;
if( this.virtualContextPath != null )
{
request = new VirtualHttpServletRequestWrapper(super._request, this.virtualContextPath);
}
this.context.handle(info, request, _response, Handler.FORWARD);
}
catch (Exception e)
{
throw new IOException("Error handling request (" + e + ")!", e);
}
}
示例2: handle
import org.mortbay.jetty.HttpException; //导入依赖的package包/类
public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException, ServletException
{
setRequestedId(request, dispatch);
WadiClusteredInvocation invocation = new WadiClusteredInvocation(target,request,response,dispatch);
try
{
invocation.invoke();
}
catch (Exception e)
{
Log.warn(e);
Throwable cause = e.getCause();
if (cause instanceof HttpException)
{
throw (HttpException) cause;
}
else if (cause instanceof IOException)
{
throw (IOException) cause;
}
else
{
throw (IOException) new IOException().initCause(cause);
}
}
}