views:

21

answers:

1

I am using struts 2 and full-hibernate-plugin-for-struts2. I would like to set fileUpload interceptor

<param name="allowedTypes">image/png,image/gif,image/jpeg</param>

Where can i find the content of defaultStackHibernate so I can do that?

A: 

From the file struts-plugin.xml. It should be in the root directory of the jar package of the plugin.

EDIT: Of course, you don't need to modify struts-plugin.xml itself. You can override interceptor definitions in your struts.xml like this:

<action name="myAction" class="myActionClass">
  <interceptor-ref name="defaultStackHibernate">
    <param name="fileUpload.allowedTypes">image/png,image/gif,image/jpeg</param>
  </interceptor-ref>
</action>

See http://struts.apache.org/2.x/docs/interceptors.html for more advice.

Tommi