A.2. RESTEasy 配置参数
| 选项名称 | 默认值 | 描述 |
|---|---|---|
| resteasy.servlet.mapping.prefix | 没有默认 |
如果 Resteasy servlet-mapping 的 URL-pattern 不是 |
| resteasy.scan | false |
为 |
| resteasy.scan.providers | false |
扫描 |
| resteasy.scan.resources | false | 扫描 JAX-RS 资源类. |
| resteasy.providers | no default |
以逗号分隔的列表,其中包含您希望 |
| resteasy.use.builtin.providers | true |
是否要注册默认的内置 |
| resteasy.resources | 没有默认 | 以逗号分隔的列表,其中包含您要注册的完全限定 JAX-RS 资源类型名称。 |
| resteasy.jndi.resources | 没有默认 | 以逗号分隔的 JNDI 名称列表,引用您要注册为 JAX-RS 资源的对象。 |
| javax.ws.rs.Application | 没有默认 |
以 spec 可移植的方式将应用程序 |
| resteasy.media.type.mappings | 没有默认 |
将文件名扩展名(如 |
| resteasy.language.mappings | 没有默认 |
将文件名扩展(如. |
| resteasy.document.expand.entity.references | false |
是否扩展外部实体,还是将它们替换为空字符串。在 JBoss EAP 中,此参数默认为 |
| resteasy.document.secure.processing.feature | true |
在处理 |
| resteasy.document.secure.disableDTDs | true |
禁止 |
| resteasy.wider.request.matching | true | 关闭 JAX-RS 规范中定义的类级表达式过滤,而是根据各个 JAX-RS 方法的完整表达式进行匹配。 |
| resteasy.use.container.form.params | true |
使用 |
| resteasy.add.charset | true |
如果资源方法返回了 |
这些参数在 WEB-INF/web.xml 文件中配置。
在 Servlet 3.0 容器中,web .xml 文件中的 配置将被忽略,所有标有 JAX-RS 的组件将被自动扫描。
resteasy.scan. *
例如,javax.ws.rs.Application 参数是在 servlet 配置 的 init-param 中配置的:
<servlet>
<servlet-name>Resteasy</servlet-name>
<servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
<init-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>org.jboss.resteasy.utils.TestApplication</param-value>
</init-param>
</servlet>
例如,resteasy.document.expand.entity.references 在 context-param 中配置:
<context-param>
<param-name>resteasy.document.expand.entity.references</param-name>
<param-value>true</param-value>
</context-param>
更改以下 RESTEasy 参数的默认值可能会导致 RESTEasy 应用程序受到 XXE 攻击的影响:
- resteasy.document.expand.entity.references
- resteasy.document.secure.processing.feature
- resteasy.document.secure.disableDTDs