I think that the controller is always going to be in struts. There
reason is this - the action will be obtaining some input, coordinating
with the back-end services, retrieving the model to be rendered and then
rendering the model into a view which could be HTML or XML/JSON which is
more "ajax-ish". So obtaining the information is self contained. If
you think of SOA or web services it is the same - the client calls a
service for a result, and is self contained.
As far as separate views go - sure. But it would need to be controlled
by the action and possible header or URI information. In the full page
case you get more information and return the whole page rendered by
returning one result, in the fragment case you return a different result
that returns a subset. I think this is how rails does it. But remember
- if you are sending all the ajax request fragments to one action it is
going to have to have a lot of different logic in it. The way I usually
construct apps is to make a base assumption that ajax is being used and
to create a namespace/URI that is for only ajax requests.
Hope this helps.
/Ian
--
From Down & Around, Inc.
Innovative IT Solutions
Software Architecture * Design * Development
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
web: www.fdar.com
email [EMAIL PROTECTED]
phone: 617.821.5430
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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?
I'm aware of much discussion of enhancing Struts Action 2 to
facilitate Ajax development. It seems I'm missing something though.
Can anyone elaborate a little on what it is facilitating?
Thanks
Adam
---------------------------------------------------------------------
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]