tag:blogger.com,1999:blog-5035358000171545600.post5695066596604727632..comments2023-06-02T04:33:34.527-07:00Comments on The Capital Code Monkey: Do AJAX Web Applications Break the MVC Pattern?iamsteveholmeshttp://www.blogger.com/profile/00043395071742403238noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-5035358000171545600.post-24640097950739228322008-10-01T18:54:00.000-07:002008-10-01T18:54:00.000-07:00Hi Kevin!I agree with you that a straight AJAX cal...Hi Kevin!<BR/>I agree with you that a straight AJAX call does not break MVC. I also realize that under some definitions of MVC, the controller ONLY controls calls between the view and the model. However, in some UI development, desktop ui for instance, you would typically use the controller for handling ALL events not just events that interact with the model. My point was that it's more DHTML than AJAX that would violate that concept. I think it's completely acceptable to have view events handled within the view.iamsteveholmeshttps://www.blogger.com/profile/00043395071742403238noreply@blogger.comtag:blogger.com,1999:blog-5035358000171545600.post-45327919149968360172008-10-01T16:47:00.000-07:002008-10-01T16:47:00.000-07:00I don't see how an ajax call breaks the MVC of the...I don't see how an ajax call breaks the MVC of the server side? If you do a traditional Struts MVC, you have action classes that are glorified "extended" servlets.. they handle the incoming requests and delegate to the logic to do something.. then forward to a JSP page to go back as the response as the "view". An ajax call would be no different than any other link call.. you'd call an action handler (and you would map them in the struts-config like any other request... be it a form, pge link, etc). So, really, your javascript is on the client side.. it's not part of the MVC. Because of that, the ajax call, on the client side, sends a request to the "mvc" struts app and as far as the struts app is concerned there is no difference. I replaced using form submits with ajax calls. The struts app was not changed.. other than that I don't use any special form validation stuff within Struts.Kevinhttps://www.blogger.com/profile/10396236895087582592noreply@blogger.com