将多个参数传递给 org.apache.cxf.jaxrs.swagger.Swagger2Feature in web.xml

Pass multiple parameters to org.apache.cxf.jaxrs.swagger.Swagger2Feature in web.xml

我有一个 java 使用 CXFNonSpringJaxrsServlet class 构建的 REST 服务器项目。 我需要配置 Swagger2Feature 将多个参数传递到 web.xml.

这是我的实际 web.xml:

<servlet>
<display-name>CXFNonSpringJaxrsServlet</display-name>
<servlet-name>CXFNonSpringJaxrsServlet</servlet-name>
<servlet-class>org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet</servlet-class>  
...
<init-param>
  <param-name>jaxrs.features</param-name>
  <param-value> 
   org.apache.cxf.jaxrs.swagger.Swagger2Feature
   <!-- Here I need to pass "scan", "title", "description".. etc -->
   (basePath=/rest)       
  </param-value>
  <load-on-startup>1</load-on-startup>
</init-param>
...

有没有办法将更多属性传递给 Swagger2 class? 否则,我可以从 ContextListener 获取 Swagger2Feature 实例来修改其他属性吗?

简单的传其他参数除以一个空格space:

org.apache.cxf.jaxrs.swagger.Swagger2Feature (basePath=/rest prettyPrint=true resourcePackage=com.your.package.name description=Your_description title=Your_title contact=info@domain.com)