您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

如何在Spring Boot中使用Tuckey urlrewrite访问使用?wsdl的服务

如何在Spring Boot中使用Tuckey urlrewrite访问使用?wsdl的服务

最后,我可以找出解决方案。现在urlrewrite.xml从src / main / resources文件夹中读取。

无需在问题post(public FilterRegistrationBean tuckeyRegistrationBean())中声明上述bean定义,因为以下声明为的代码@Component自动在上下文中注册并执行url重写。

@Component
public class WsdlUrlRewriteFilter extends UrlRewriteFilter {

    private static final String CONfig_LOCATION = "classpath:/urlrewrite.xml";

    @Value(CONfig_LOCATION)
    private Resource resource;

    @Override
    protected void loadUrlRewriter(FilterConfig filterConfig) throws ServletException {
        try {
            Conf conf = new Conf(filterConfig.getServletContext(), resource.getInputStream(), resource.getFilename(), "");
        checkConf(conf);
        } catch (IOException ex) {
            throw new ServletException("Unable to load URL-rewrite configuration file from " + CONfig_LOCATION, ex);
        }
    }
}
Java 2022/1/1 18:13:52 有563人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶