On 10/28/06, Don Brown <[EMAIL PROTECTED]> wrote:
Well, my original purpose is to find a way to best handle the case where
we want to generate multiple types of output without the Action being
aware of it.  Foremost in my mind is the ability to have an action be
called and expect HTML, partial HTML, or JSON without affecting the
Action.

Then how about a "Result Controller" that can select among possible
results, the same way that an Action can. The Action can focus on the
business logic, and the Result Control can focus on the view logic,
but they could others look and feel the same.

A single result controller could handle all the selection logic for
the result code returned by the action.

<result-selector name="agent" class="o.a.s.d.UserAgentResultSelector"/>

<action name="ViewFoo" class="mypackage.ViewFooAction">

  <selector type="agent">
    <result name=""modern-browser">ViewFoo.jsp</result>
    <result name="netscape4">ViewFoo-netscape4.jsp</result>
 </selector>

  <selector name="failure" type="agent">
    <result name=""modern-browser">ViewFoo-failure.jsp</result>
    <result name="netscape4">ViewFoo-netscape4-failure.jsp</result>
 </selector>

Of course, if a majority of the results were "agent", we could make
that type the default selector.

The result selector might just be a specialized kind of Action,  with
the same capabilities, but simply assigned a speciallized  role.

-Ted.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to