相关疑难解决方法(0)

如何在Apache CXF中抛出403错误 - Java

我正在使用以下基于拦截器的代码.当check返回true时,我想抛出403错误:

    @Override
    public void handleMessage(Message arg0) throws Fault {


        HttpServletRequest request = context.getHttpServletRequest();
        if(check(request)){
        // currently not working
                throw "Fault";
        }
Run Code Online (Sandbox Code Playgroud)

我想抛出403错误.我如何从这种情况中做到这一点?

关于"抛出错误"是如何工作的我有点困惑.

任何帮助表示赞赏

java apache error-handling cxf exception

3
推荐指数
1
解决办法
2074
查看次数

标签 统计

apache ×1

cxf ×1

error-handling ×1

exception ×1

java ×1