On 10/26/06, Don Brown <[EMAIL PROTECTED]> wrote:
Hmm...probably because I didn't know about it :)

.... perhaps  :-)
Should we move the code back into Struts 2?

At some point I guess it may make sense to do this. For the moment
(and until it stabilizes and the struts2 stabilizes), I think it is
better for it out there.

 What exactly does it do?

Simply put it allows you to call from DWR a normal action, passing
through its normal execution chain. The result can be the rendered
result (as in normal action invocations) or a serialized action object
(as in <ww:action executeResult="false" />).

./alex
--
.w( the_mindstorm )p.

Don

Alexandru Popescu wrote:
> Wille, I have contributed a long time ago some (similar?) code to DWR.
> You can find it in the DWR trunk (a webwork package) . This
> integration code is based on some work I initially done for InfoQ.com.
>
> Sure, if you find places where your ideas look better then my approach
> I would be happy to hear from you and improve it. I am a bit puzzled
> that Don haven't pointed you to this existing code, as the discussions
> about where this code should live have been public by that time.
>
> ./alex
> --
> .w( the_mindstorm )p.
>
>
> On 10/26/06, Wille Faler <[EMAIL PROTECTED]> wrote:
>> Hi.
>> I raised the question today on Don Browns blog about being able to have
>> integration between Struts2 and DWR, to get a full MVC model if you only
>> want to re-render a snippet of a web-page.
>> I am not sure if this has been discussed previously, but Don encouraged
>> me to send my ideas if I had any, so here goes:
>> When I have done AJAX-based stuff, 9 times out of 10, all I really want
>> to do i execute some business logic, and re-render a portion of a page.
>> This would seem to fit well with a traditional MVC-approach, with the
>> exception that I don't want to re-render the full page.
>>
>> Earlier this year, I implemented such a simple framework, basically
>> using Webwork2/XWork and DWR, adding some code to glue it all together.
>> It consists of the following things:
>> - Some generic JavaScript that can interpret parameters (either from a
>> form or URL) into a Map of parameters, akin to what Webwork uses.
>> - A Controller that is called by DWR, taking the Map, a callback-target
>> (in the web-page) and the name of an action as its arguments. This
>> Controller then invokes an xwork ActionProxy to invoke the Action.
>> - Custom Result-implementations for getting JSP-elements defined in the
>> xwork results. These results use the DWR
>> WebContextFactory.get().forwardToString() functionality, to get the
>> resulting JSP-snippet as a String.
>> - Said Result can then be sent back by the Controller through DWR, which
>> is then handled by generic JavaScript and rendered to the predefined
>> callback-target on the page.
>> - When using forms, it can also do AJAX-based validation which makes use
>> of proper Xwork-validation.
>>
>> As I said, I have already written code for this, it is quite compact and
>> only a few hundred lines (11 implementation classes + generic JavaScript
>> + dwr config), so obviously this integration is quite easy to create. I
>> would love to see something similar within the upcoming Struts2!
>> I haven't attached the code to this mail, but it is available for
>> download here: www.infonatural.com/ajax-mvc.zip (including
>> jar-dependencies and some unit-tests, 3.6mb).
>>
>> If anyone wants to pick the code for ideas, or adapt it, feel free to do
>> so as long as you retain the original @author comments as part of it (I
>> am the sole copyright holder of the code, and you may use it under the
>> ASF if you want).
>> It would probably need some minor improvements to make it more in line
>> with the rest of the Struts2-code (so tags work etc), as I only did the
>> code originally for my needs and didn't bother doing more than I needed
>> at the time.
>>
>> I apologise if this or something similar is already part of Struts2, but
>> I got the impression that it may not be.
>>
>> regards
>> Wille Faler
>>
>>
>> ---------------------------------------------------------------------
>> 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]

Reply via email to