views:

139

answers:

0

I'm writing a new result type for struts2 (aka webwork) and I can't figure out how to configure the result type.
The configuration should include stuff like TEMPLATE_PATH or REFRESH_INTERVAL etc, e.g. those are global configuration options per the result type, not per specific action.
The result configuration looks like that:

<result-types>
    <result-type name="stringtemplate" class="org.apache.struts2.dispatcher.StringTemplateResult"/>
</result-types>

I'd like to be able to say something like

<result-types>
    <result-type name="stringtemplate" class="org.apache.struts2.dispatcher.StringTemplateResult">
      <init-param name="TEMPLATE_PATH" value="/WEB-INF/st/"/>
      <init-param name="foo" value="xxx"/>
    </result-type>
</result-types>

I haven't been able to find support for that. What's the recommended way of configuring result types?

Thanks!