Don Brown wrote:
David H. DeWolf wrote:
That said, didn't I read somewhere that we're moving towards getting
rid of struts.properties? Wouldn't it be easier and more consistent
to just add the following to struts.xml:
<result-selector class="o.a.s.dispatcher.ContentTypeResultSelector"/>
Seems to me like this type of configuration is very similar to the
interceptor configuration and should be designed similarly.
Actually, I'd prefer we went the other direction, get rid of the need
for struts.xml, but maybe that's just me. The question is if they need
to be configured on a package/action basis. If they can be done
globally, then struts.properties is the better place. Otherwise,
struts.xml would be a better fit.
Fair point, perhaps not. I'll have to think about that one.
If we used the <result-selector> element, how would you define multiple
ones? Just repeating the element wouldn't match the style of other
configuration elements. How would this look as one or more annotations?
Really? Seems similar to me. I'm not suggesting that the result-selector
would replace the when attribute, instead, I'm suggesting that we mimic:
<interceptor name="foo" class="o.a.s.i.FooInterceptor"/>
<interceptor name="bar" class="o.a.s.i.BarInterceptor"/>
<interceptor-stack name="myStack">
<interceptor-ref name="foo"/>
<interceptor-ref name="bar"/>
</interceptor-stack>
with:
<result-selector class="o.a.s.d.UserAgentResultSelector"/>
<action name="ViewFoo" class="mypackage.ViewFooAction">
<result name="success" when="modern-browser">foo.jsp</result>
<result name="success" when="netscape4">foo-ns4.jsp</result>
</action>
This basically allows for custom selectors to be registered. Like you
say, if they do not need to be scoped at the package/action level, then
you could definitely achieve the same thing with struts.properties
(pending the discussion of:
https://issues.apache.org/struts/browse/WW-1421).
It's really not a big deal, as long as I do have the ability to register
new implementations. My preference would be for that configuration to
be in the same location as where I specify all the other custom
components I've developed - either as attributes or in struts.xml.
As far as attributes go, they render the configuration irrelevant. Am I
missing something?
@Selector
would simply replace the result-selector configuration.
@Result(name="success", when="modern-browser")
would replace the <result name="success" when="modern-browser">.
David
Don
David
Don
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]