我使用Apache-cxf(JAX-RS)和spring框架。我在beans.xml中有以下示例代码。
<jaxrs:server id="services" address="${http.server}">
<jaxrs:properties>
<entry key="attachment-max-size" value="1024" />
</jaxrs:properties>
<jaxrs:serviceBeans>
<bean id="mainResource" class="com.abc.rest.api.MainResource">
<lookup-method name="createEmployeeCollectionResource"
bean="employeeCollectionResource" />
</bean>
...
...other beans
...
</jaxrs:serviceBeans>
</jaxrs:server>
字符串
我也有以下代码
<bean id="employeeCollectionResource"
class="com.abc.rest.services.EmployeeCollectionResourceImpl">
<lookup-method name="createNewEmployeeResource" bean="employeeResource" />
</bean>
<bean id="employeeResource" scope="prototype"
class="com.abc.rest.services.EmployeeResourceImpl">
</bean>
型
我已经设置了最大文件大小在上传为1 KB的所有服务一般。
我如何限制attachment-max-size
用于特定的几个bean?示例-5 MB用于几个bean,2 MB用于几个其他bean,等等
1条答案
按热度按时间cbjzeqam1#
您必须在单独的
<jaxrs:server >
标签中组织端点/资源,并对其附件大小进行自己的设置:字符串
https://cxf.apache.org/docs/jax-rs-multiparts.html