So struts marshalls the HTTP request params into a form bean and perhaps validates them.
Also struts interfaces with the model when it calls business methods from action classes.
But for Ajax requests then there is only ever one possible actionForward (or 2 if you count a global error). I can't imagine there's ever any need for doing different things with the data - it's (un)marshalled into xml, right?
Adam Samere on 24/05/06 22:57, wrote:
I've recently used AJAX in some existing Struts applications making use
of AjaxTags http://ajaxtags.sourceforge.net/. The Struts controller is
still very much applicable, in that the Ajax requests are made to struts
action urls, the action subclasses then delegate processing to business
objects in the same way as we're used to, and finally forward to a JSP
for generating the output. The major difference is the JSP's generate
XML responses, rather than HTML/XHTML. Essentially they return either a
page fragment or an XML item list of some type which is then parsed and
stuffed into the client side DOM using javascript for immediate display.
Adam Hardy wrote:
I have only a small knowledge of the Ajax frameworks out there and I
am trying to work out how much an Ajax app would depend on Struts.
I assume the view in an Ajax app is handled at the initial request by
a JSP with HTML and that afterwards every request from the browser is
XHR, ideally broken down on a per-data-item/list basis. The view HTML
is from there on in handled by Ajax. In that case the Controller part
of MVC would be managed entirely client-side.
Therefore all that struts would have to offer the app would be
Validator and perhaps a couple of other services.
Or am I totally wrong? Can struts offer the ability to manage the
Controller part of the app in such a way that the project could have
two views - one in Ajax and one in JSPs?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]