Ok in principle then it seems fine it's just I don't like the fact that a scripting language whether client or server side can be embedded in the presentation logic, it still seems like a bit of a workaround. I've wondered about whether the Model2X approach and the Model 2 approach for some while now and it seems like the latter doesn't seperate the concerns as much as Model 2X. The only thing that makes me doubt this is the fact that Sun and yourself have gone this way via the Model 2 approach with Java Server Faces rather than the Model 2 approach. Is there any particular reason why this method is preferred over the Model 2X approach?
Jon. -----Original Message----- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 19:22 To: Struts Users Mailing List Subject: RE: Complicated Web Interfaces? (Waiting for the turkey to be ready ... :-) On Thu, 28 Nov 2002, Jonathan Holloway wrote: > Date: Thu, 28 Nov 2002 09:11:51 -0000 > From: Jonathan Holloway <[EMAIL PROTECTED]> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]> > To: 'Struts Users Mailing List' <[EMAIL PROTECTED]> > Subject: RE: Complicated Web Interfaces? > > Ok fair enough but surely the issue of embedding all this javascript > In my html is reversing the whole embedding presentation logic within > business logic? Surely embedding javascript in a JSP is just as bad > as embedding scriptlets in a JSP? Or am I missing the point here > somewhere :) ? > The big difference is that scriptlets execute on the server, as the page is being generated -- and have access to the entire object model of your application (leading to the temptation to embed business logic there). JavaScript doesn't execute on the server, it executes on the client, and doesn't have direct access to your business objects. Embedding JavaScript to enhance the user experience (i.e. improve the quality of the presentation) is fine. An example of this is the client side validation JavaScript that can be created by the Validator Framework -- this improves life for the user by catching errors earlier. Using JavaScript to send background HTTP requests that grab stuff directly from the database (bypassing the normal control flow) and changing the contents of select lists is a little more iffy -- but some intranet based apps (where the 100mbps network makes it pretty fast) will undoubtedly use such techniques to more accurately simulate what a GUI app can do. You can still flow such requests through the controller servlet, though -- to special actions that just return data instead of HTML -- and that seems fairly reasonable. > Jonathan Holloway. > Craig > -----Original Message----- > From: Affan Qureshi [mailto:[EMAIL PROTECTED]] > Sent: 28 November 2002 03:31 > To: Struts Users Mailing List > Subject: Re: Complicated Web Interfaces? > > My comment between lines. > > > Say I want to display two lists of objects and swap lists in and out > of > > these two > > lists as required. > > > > List A --> List B > > Object A Object C > > Object B > > > > e.g. Move object B to List B > > > > I also want to add/remove objects as required to these lists. Is this > > possible in > > Struts. I've looked at the struts-layout library on > > http://struts-application-servers.com/ > > but it look sto be buggy. Has anbody actually had any success with > > this? > > This is shown in Tiles portal example. Works pretty well for simple > purposes. Look at the place where you can add, delete, change tiles in > the > portal setup. You dont have to use tables like struts-layout. You can > use > some HTML select lists and some simple JS to manipulate them. > > > I also want to be able to display a tree component to a user and allow > > the user to > > manipulate the tree by adding or removing nodes to the tree. Is this > > possible with > > any of the struts user interface components or will I have to use an > > applet or a > > sophiticated javascript tree to achieve this. If so how do I > integrate > > it with Struts? > > Struts is just another Web application and runs servlets and JSPs. You > need > to come up with your own way to intergrate your stuff (JavaScript, > Applets) > with it. Struts does not provide you with an IDE. It provides you with a > framwork to make your work easy. > > > I've also looked at the monkey-struts example as well but that seems > to > > lack the > > creation of objects in these lists, which doesn't look to be a problem > > to implement > > but that might be an oversight on my part : ) please let me know if > I'm > > wrong. > > > > KB-Monkey-example uses a fixed object model (i.e it knows what fields > are > there in each object). However I think if you want the tree to be > dynamic > you can use the same technique with your own object model (which seems > to be > dynamic in content). The key to adding and deleting the nodes is the way > the > button clicks of "Add" and "Delete" are handled in a nested environment. > Nested tags enable you to remember the context of added and deleted > objects/nodes. You can use Map-backed properties for dynamic > form-fields. > > But one issue with the monkey example is that it refreshes the page if I > want to add/delete an object/node. Wouldn't it be more efficient to use > JavaScript for the purpose? I mean why resend the request back to the > server > if you only want to add "blank" fields? If anybody has accomplished this > I > would be glad to know. > > > I know there's a lot of questions abou the above and I'm still > pondering > > them as well > > myself but I just wanted to know whether it is possible to do this in > > Struts at present. > > From what I can see it is possible to create simple web based > > applications using > > Struts but I haven't come across any really complicated web interfaces > > yet using > > Struts, has anybody got any ideas on this or any examples of web > > applications that > > are a little more compicated. > > > Many thanks, > > Jon Holloway. > > > > If you find any such resource please let us know. > > Regards, > > Affan > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>