我正在使用struts 2和full-hibernate-plugin-for-struts2。我想设置fileUpload拦截器
<param name="allowedTypes">image/png,image/gif,image/jpeg</param>
我在哪里可以找到defaultStackHibernate的内容,所以我可以这样做?
答案 0 :(得分:0)
来自档案struts-plugin.xml
。它应该在插件的jar包的根目录中。
编辑:当然,您无需修改struts-plugin.xml
本身。您可以在struts.xml
中覆盖拦截器定义,如下所示:
<action name="myAction" class="myActionClass">
<interceptor-ref name="defaultStackHibernate">
<param name="fileUpload.allowedTypes">image/png,image/gif,image/jpeg</param>
</interceptor-ref>
</action>
有关更多建议,请参阅http://struts.apache.org/2.x/docs/interceptors.html。