Re: [S2+AJAX]Which ajax libray did you use?
On Jan 17, 2008 10:20 PM, Tony Zhang [EMAIL PROTECTED] wrote: For YUI + struts2, do you prefer to use YUI plugin for struts2 or just use YUI directly? Do we need to use DWR to transfter data? You can just use YUI directly. Essentially, what's being replaced is the JSPs. With Ajax, we can start with an HTML page and use JavaScript to merge in the dynamic data returned from the server. No taglib required. With Ajax, the difference is not in the request, but in the response. With Struts + Ajax, you can just make an ordinary request to an Action, and let Struts convert the input parameters for use with the Action. To Struts, an Ajax request looks like any other request. The Action can do what the Action always does. The key is that instead of using a result that forwards to a JSP, we can use a result that returns JSON or some other payload in the response. On the Ajax side, the script uses whatever we return in the response to update the page. The same strategy works just as well with Struts 1, and some people have been doing this sort of thing with Struts 1 since before Jesse gave us the name Ajax. DWR is also a good way to go, but it overlaps with Struts. I'd use one or the other, and either one will get the job done. If you just need to call a server side class from an Ajax page, DWR is ideal. Though, it doesn't have any added-value features, like validation. Last I knew, DWR also doesn't anything like an Interceptor stack to customize handling of the request/response pipeline, or other results for other formats, like JasperReports. Ted, I looked through your sample struts-pim.war. In that sample, you don't use YUI plugin for struts2, just using js to call the struts2 action directly. My question is which way is better, YUI plugin or no YUI plugin? So far, all the Dojo or YUI plugins do is add Ajax features to the JSP tags. My preference is to go JSP free, which means there's no reason to use the a JSP tag plugin. If I were going to use tags, I'd probably go with the AjaxParts taglib, which is covered by other other Ajax Experience presentation. * http://www.StrutsUniversity.org/Retrofitting+Struts+for+Ajax+Taglibs HTH, Ted http://www.StrutsMentor.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2+AJAX]Which ajax libray did you use?
Check out the Slides and WAR from the AE session. * http://www.StrutsUniversity.org/Coding+Ajax+Applications+with+Struts I could extract a hello world example from these, but it might be a few days. HTH, Ted http://www.StrutsMentor.com/ On Jan 18, 2008 7:52 AM, bhaarat Sharma [EMAIL PROTECTED] wrote: is there a tutorial that shows how to set up struts 2 to use YUI. just a simple hello world. thanks -bhaarat On Jan 18, 2008 7:10 AM, Ted Husted [EMAIL PROTECTED] wrote: Under the heading, does Ajax need a web framework, there's an interesting nope blog here: * http://unclescript.blogspot.com/2008/01/alternatives-to-server-side-web.html Though, it's interesting to note that the author equates web frameworks with server-side page rendering. That's one thing that frameworks like Struts do, but we also provide server-side supports for security, validation, text formatting, and alternate result processing. I'm a huge Ajax fan. In fact, outside of example applications and training courses, I haven't touched a server page in over a year. But Ajax is not an island, and I'm thinking that there are many services that a web framework can provide that have nothing to do with tag libraries. Moving forward, I'd like to see Struts extend its Ajax use cases beyond taglib plugins, and focus on what else we can do to make application developer easier for us on the server-side. HTH, Ted http://www.StrutsMentor.com/ - 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]
Re: [S2+AJAX]Which ajax libray did you use?
is there a tutorial that shows how to set up struts 2 to use YUI. just a simple hello world. thanks -bhaarat On Jan 18, 2008 7:10 AM, Ted Husted [EMAIL PROTECTED] wrote: Under the heading, does Ajax need a web framework, there's an interesting nope blog here: * http://unclescript.blogspot.com/2008/01/alternatives-to-server-side-web.html Though, it's interesting to note that the author equates web frameworks with server-side page rendering. That's one thing that frameworks like Struts do, but we also provide server-side supports for security, validation, text formatting, and alternate result processing. I'm a huge Ajax fan. In fact, outside of example applications and training courses, I haven't touched a server page in over a year. But Ajax is not an island, and I'm thinking that there are many services that a web framework can provide that have nothing to do with tag libraries. Moving forward, I'd like to see Struts extend its Ajax use cases beyond taglib plugins, and focus on what else we can do to make application developer easier for us on the server-side. HTH, Ted http://www.StrutsMentor.com/ - 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]
Re: [S2+AJAX]Which ajax libray did you use?
You may find this also useful. http://www.struts2.org/creating-a-cascading-application-menu-using-struts2-and-yui/ On Jan 18, 2008 6:29 PM, Ted Husted [EMAIL PROTECTED] wrote: Check out the Slides and WAR from the AE session. * http://www.StrutsUniversity.org/Coding+Ajax+Applications+with+Strutshttp://www.strutsuniversity.org/Coding+Ajax+Applications+with+Struts I could extract a hello world example from these, but it might be a few days. HTH, Ted http://www.StrutsMentor.com/ http://www.strutsmentor.com/ On Jan 18, 2008 7:52 AM, bhaarat Sharma [EMAIL PROTECTED] wrote: is there a tutorial that shows how to set up struts 2 to use YUI. just a simple hello world. thanks -bhaarat On Jan 18, 2008 7:10 AM, Ted Husted [EMAIL PROTECTED] wrote: Under the heading, does Ajax need a web framework, there's an interesting nope blog here: * http://unclescript.blogspot.com/2008/01/alternatives-to-server-side-web.html Though, it's interesting to note that the author equates web frameworks with server-side page rendering. That's one thing that frameworks like Struts do, but we also provide server-side supports for security, validation, text formatting, and alternate result processing. I'm a huge Ajax fan. In fact, outside of example applications and training courses, I haven't touched a server page in over a year. But Ajax is not an island, and I'm thinking that there are many services that a web framework can provide that have nothing to do with tag libraries. Moving forward, I'd like to see Struts extend its Ajax use cases beyond taglib plugins, and focus on what else we can do to make application developer easier for us on the server-side. HTH, Ted http://www.StrutsMentor.com/ http://www.strutsmentor.com/ - 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]
Re: [S2+AJAX]Which ajax libray did you use?
that is an awesome site for struts2. has lot of good examples !! On Jan 19, 2008 2:36 AM, Jayson Joseph Chacko [EMAIL PROTECTED] wrote: You may find this also useful. http://www.struts2.org/creating-a-cascading-application-menu-using-struts2-and-yui/ On Jan 18, 2008 6:29 PM, Ted Husted [EMAIL PROTECTED] wrote: Check out the Slides and WAR from the AE session. * http://www.StrutsUniversity.org/Coding+Ajax+Applications+with+Strutshttp://www.strutsuniversity.org/Coding+Ajax+Applications+with+Struts I could extract a hello world example from these, but it might be a few days. HTH, Ted http://www.StrutsMentor.com/ http://www.strutsmentor.com/ On Jan 18, 2008 7:52 AM, bhaarat Sharma [EMAIL PROTECTED] wrote: is there a tutorial that shows how to set up struts 2 to use YUI. just a simple hello world. thanks -bhaarat On Jan 18, 2008 7:10 AM, Ted Husted [EMAIL PROTECTED] wrote: Under the heading, does Ajax need a web framework, there's an interesting nope blog here: * http://unclescript.blogspot.com/2008/01/alternatives-to-server-side-web.html Though, it's interesting to note that the author equates web frameworks with server-side page rendering. That's one thing that frameworks like Struts do, but we also provide server-side supports for security, validation, text formatting, and alternate result processing. I'm a huge Ajax fan. In fact, outside of example applications and training courses, I haven't touched a server page in over a year. But Ajax is not an island, and I'm thinking that there are many services that a web framework can provide that have nothing to do with tag libraries. Moving forward, I'd like to see Struts extend its Ajax use cases beyond taglib plugins, and focus on what else we can do to make application developer easier for us on the server-side. HTH, Ted http://www.StrutsMentor.com/ http://www.strutsmentor.com/ - 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]
Re: [S2+AJAX]Which ajax libray did you use?
Thanks to Jeromy and Ted , your comments definitely help me a lot. I looked through the YUI website, the widgets are quite rich. I still concern about if I want to use the Struts2 + YUI, I have to know pretty much about the YUI , right? Is YUI easy to learn and use? Since our developers don't know much about javascript. And about GWT+ Struts2, I think the html code compiled by GWT is hard to read. And if I only want to use ajax for partical page, is there any issue? How do you think of this? There is a JSF plugin for struts2, the developer can develop web page using JSF component. There is a sample is about integrating struts2+jsf+facelets http://raibledesigns.com/rd/entry/integrating_struts_2_jsf_facelets. From the comments, we can use the Ajax4jsf, and I find the RichFaces library has the ajax support and provides many function. Seems that the developers don't need to write javascript when using that ajax tag. Is there anyone success with this way? And how do you think? Thanks -- View this message in context: http://www.nabble.com/-S2%2BAJAX-Which-ajax-library-did-you-use--tp14903828p14917381.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2+AJAX]Which ajax libray did you use?
On Jan 17, 2008 7:07 AM, tzhang [EMAIL PROTECTED] wrote: Thanks to Jeromy and Ted , your comments definitely help me a lot. I looked through the YUI website, the widgets are quite rich. I still concern about if I want to use the Struts2 + YUI, I have to know pretty much about the YUI , right? Is YUI easy to learn and use? Since our developers don't know much about javascript. It's not as much a matter of learning YUI as it is a matter of learning the proper way to code in JavaScript. A good start there is to go through the Douglas Crockford — The JavaScript Programming Language videos on the YUI theatre site. * http://developer.yahoo.com/yui/theater/ (Really, do this today!) Personally, I find creating interfaces in JavaScript to be much simpler than wresting with server tags and scriplets. If we had in 1998 the JavaScript libraries and tools we have in 2008, server pages and JSF would never have been invented. As for YUI itself, my team was an early adopter of the DataTable (as in the first beta). We ran into issues, but even as novice JavaScript programmers, we never found an issue we couldn't patch by reviewing the code. Of course, having tools like FireBug that let you step through the scripts makes a world of difference. HTH, Ted http://www.StrutsMentor.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2+AJAX]Which ajax libray did you use?
* http://developer.yahoo.com/yui/theater/ (Really, do this today!) I completely agree with Ted! My only word of caution is that YUI is oriented towards software developers. Creatives are probably going to prefer libraries like Mootools that provide simple to use widgets that you don't need to understand (http://demos.mootools.net/). The suitability depends on the type of application you're building. My preference is to write correct javascript. With respect to GWT, my only experience is experimental (and I bought a book on it!), but if you go down that path you need to make a paradigm shift and stop caring how the html looks. You develop in an environment like Swing with layout managers. UI design needs to follow the same approach you'd use when developing a normal rich application. This paradigm-shift seems to scare off most traditional web developers but attracts developers that prefer the swing-like event model. GWT is probably not suitable if you only need a couple of widgets in a traditional web page. I stopped experimenting with GWT when I realized javascript was actually good. I can't comment on the JSF features. regards, Jeromy Evans . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2+AJAX]Which ajax libray did you use?
I definitely found YUI to be a pleasant experience as well while writing the chapter on it my second book. It's one of the easier libraries to pick up, even for novice JS programmers, which is something I've heard frequently from many different sources. That's not something you can say about a great many JS libraries out there today. My only complaint, if it can be called that, is that I don't find the widgets to be all that rich, as compared to many other available options. That's in no way to say they are bad, and they're more than sufficient, and even more appropriate, in many situations. But if you're looking to create real cutting-edge, very fancy UIs, YUI *may* not be the best choice. It's interesting that when someone asks what AJAX library to use with S2, most of the replies are really full-fledged RIA libraries. Certainly GWT falls in that category, as would YUI I think. Are you looking truly for AJAX alone, or do you really need all the bells and whistles, widgets, effects, all that sort of stuff? If it's plain AJAX you're after, there are some solid options. Prototype is one of the best, very small, simple, powerful. APT is good if you prefer the taglib and no JavaScript at all approach. DWR is probably my personal favorite right now (err, other than APT! LOL) Just the appropriate module from Mootools or Dojo is good. jQuery is certainly an excellent choice. That's just to name a few. If it's a full RIA library you're after, the answers might be a little different. ExtJS is one of the best (although there seems to be some concern about licensing that I've seen, I'm not fully conversant on it though). Dojo is always a viable choice, and is considerably more so since the 1.0 release hit. I personally have had *great* success with dhtmlx components (which couldn't be considered a full RIA library, but for widgets there's few better IMO). jQuery has a robust ecosystem of widgets from what I've heard (no hands-on experience yet). GWT is interesting if, as someone else said, you're willing to accept the paradigm shift. Probably everyone around here knows my personal feelings about JSF, but that doesn't change the fact that it's always worth considering. It all comes down to what you need. If it's just plain AJAX, it's a different question than if you are looking for widgets and the whole shebang (even if the line is certainly blurring these days). Frank -- Frank W. Zammetti Author of Practical DWR 2 Projects (2008, Apress, ISBN 1-59059-941-1) and JavaScript, DOM Scripting and Ajax Projects (2007, Apress, ISBN 1-59059-816-4) and Practical Ajax Projects With Java Technology (2006, Apress, ISBN 1-59059-695-1) Java Web Parts - http://javawebparts.sourceforge.net Supplying the wheel, so you don't have to reinvent it! On Thu, January 17, 2008 7:18 am, Ted Husted wrote: On Jan 17, 2008 7:07 AM, tzhang [EMAIL PROTECTED] wrote: Thanks to Jeromy and Ted , your comments definitely help me a lot. I looked through the YUI website, the widgets are quite rich. I still concern about if I want to use the Struts2 + YUI, I have to know pretty much about the YUI , right? Is YUI easy to learn and use? Since our developers don't know much about javascript. It's not as much a matter of learning YUI as it is a matter of learning the proper way to code in JavaScript. A good start there is to go through the Douglas Crockford The JavaScript Programming Language videos on the YUI theatre site. * http://developer.yahoo.com/yui/theater/ (Really, do this today!) Personally, I find creating interfaces in JavaScript to be much simpler than wresting with server tags and scriplets. If we had in 1998 the JavaScript libraries and tools we have in 2008, server pages and JSF would never have been invented. As for YUI itself, my team was an early adopter of the DataTable (as in the first beta). We ran into issues, but even as novice JavaScript programmers, we never found an issue we couldn't patch by reviewing the code. Of course, having tools like FireBug that let you step through the scripts makes a world of difference. HTH, Ted http://www.StrutsMentor.com/ - 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]
Re: [S2+AJAX]Which ajax libray did you use?
Thanks you again for reply my question. I got another question, For YUI + struts2, do you prefer to use YUI plugin for struts2 or just use YUI directly? Do we need to use DWR to transfter data? Ted, I looked through your sample struts-pim.war. In that sample, you don't use YUI plugin for struts2, just using js to call the struts2 action directly. My question is which way is better, YUI plugin or no YUI plugin? -- View this message in context: http://www.nabble.com/-S2%2BAJAX-Which-ajax-library-did-you-use--tp14903828p14945315.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2+AJAX]Which ajax libray did you use?
Tony Zhang wrote: For YUI + struts2, do you prefer to use YUI plugin for struts2 or just use YUI directly? I'm probably not the best person to answer that because I'm frankly not using S2 at the moment and have never looked at the YUI plugin. If you're comfortable with Javascript coding and client-side development, my *guess* is there's a little more freedom not using the plugin, but others can certainly shed more light there than I can. Do we need to use DWR to transfter data? DWR allows you to call server-side object from your client-side Javascript in a way that, for the most part, makes it look like it's all executing in the same process space. What that ultimately means is you stop thinking about transferring data entirely and instead think about the same things you think about when you code in pure Java: what methods or what objects do you call, and what object to you get back. It's a fantastically elegant way to go, but it also to a large extent makes what framework you use irrelevant (I'm personally becoming more and more convinced every day that it makes it not just irrelevant but actually counter-productive to use a framework at all). Frank -- Frank W. Zammetti Author of Practical Ajax Projects With Java Technology (2006, Apress, ISBN 1-59059-695-1) and JavaScript, DOM Scripting and Ajax Projects (2007, Apress, ISBN 1-59059-816-4) and Practical DWR 2 Projects (2008, Apress, ISBN 1-59059-941-1) Java Web Parts - http://javawebparts.sourceforge.net Supplying the wheel, so you don't have to reinvent it! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2+AJAX]Which ajax libray did you use?
Frank W. Zammetti wrote: Tony Zhang wrote: For YUI + struts2, do you prefer to use YUI plugin for struts2 or just use YUI directly? I'm probably not the best person to answer that because I'm frankly not using S2 at the moment and have never looked at the YUI plugin. If you're comfortable with Javascript coding and client-side development, my *guess* is there's a little more freedom not using the plugin, but others can certainly shed more light there than I can. Agreed. The YUI plugin for Struts2 doesn't add much value and that's why it's basically stagnant. It defines some tags that output default html and inline javascript that's okay for some cases, but more often than it's better just to use html and javascript following YUI's/Crockford's recommended approach (eg. no inline script). That being said, I have created anchor, submit, div and tabview tags for the YUI plugin so I could easily migrate an existing application from the dojo plugin. Frequently though, I set the noscript attribute to true so the tags just output html without script. They're nowhere near as capable as the existing dojo tags and I don't expect they ever will be. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2+AJAX]Which ajax libray did you use?
I am doing some research ajax+struts2. you know struts2.0 has the built-in supprot for ajax based on Dojo, but I found the components is not very rich, only have some basic function. I know there are a lot of ajax components for JSF. So what did you do for struts2, develop your costom widgets or use the third party ajax library? If you use the third party ajax libray? Could you tell me which library is better? And give me some comments about how to integrate with struts2? Thanks -- View this message in context: http://www.nabble.com/-S2%2BAJAX-Which-ajax-libray-did-you-use--tp14903828p14903828.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2+AJAX]Which ajax libray did you use?
ExtJS and jQuery. On Jan 16, 2008 5:56 PM, tzhang [EMAIL PROTECTED] wrote: I am doing some research ajax+struts2. you know struts2.0 has the built-in supprot for ajax based on Dojo, but I found the components is not very rich, only have some basic function. I know there are a lot of ajax components for JSF. So what did you do for struts2, develop your costom widgets or use the third party ajax library? If you use the third party ajax libray? Could you tell me which library is better? And give me some comments about how to integrate with struts2? Thanks -- View this message in context: http://www.nabble.com/-S2%2BAJAX-Which-ajax-libray-did-you-use--tp14903828p14903828.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2+AJAX]Which ajax libray did you use?
You can use any client-side library you choose with Struts2. There's no reason why you should encounter incompatibilities provided the library can handle html, xml or json responses from your actions. I used Dojo 0.4 a lot but have completely moved over to YUI now. My main frustration with Dojo was the sparsity of documentation and the developer's focus on 0.9+. It's a sophisticated framework though and version 1.0 shouldn't be automatically discounted. I haven't used 1.0 but Dijit seems to have nice widgets. The benefits of YUI are: - it's a simple and elegant design - it's obsessively well documented - it's designed for software developers (ie. well-designed, pattern-focused, object-oriented javascript) - it's growing in functionality and users at a phenomenal rate - it's degrades gracefully for bad browsers - there's good extensions available for it The weaknesses of YUI are : - it doesn't include all the glossy widgets available in other libraries - many web developers don't understand well-designed, pattern-focused, object-oriented software and don't want to - many web applications don't need a framework like this on the client-side anyway (eg. if you just want animation effects) ExtFS is built upon YUI and adds some nice functionality and widgets. Check the license though. DED|Chain is built upon YUI to add JQuery-like APIs more familiar to web developers/designers. Check out Dunstin's Javascript tetris: http://www.dustindiaz.com/basement/tetris-s.html to see the potential. The Bubbling Library adds an alternative event mechanism and widgets to YUI It really depends on what kind of application you're building and the kind of developers working on the client-side. If you're reluctant to learn javascript *correctly* some impressive Rich Internet Applications have also been built with Google Web Toolkit (GWT). It's very easy to get started and the GWT plugin for Struts2 simplifies integration with this framework. The Texas Hold'em Poker example shows the strength of translating java to javascript: http://www.gpokr.com/ Hope that's helpful, Jeromy Evans tzhang wrote: I am doing some research ajax+struts2. you know struts2.0 has the built-in supprot for ajax based on Dojo, but I found the components is not very rich, only have some basic function. I know there are a lot of ajax components for JSF. So what did you do for struts2, develop your costom widgets or use the third party ajax library? If you use the third party ajax libray? Could you tell me which library is better? And give me some comments about how to integrate with struts2? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2+AJAX]Which ajax libray did you use?
I'm a fan of YUI myself. A good way to go with Struts/Ajax integration is to make an ordinary request to an action, and then return a JSON response. This provides the benefits of JSON, but avoid some of the overhead of a JSON/RPC call. I actually did a presentation at the Boston Ajax Experience on this topic. The slides can be found here: * http://www.StrutsUniversity.org/Coding+Ajax+Applications+with+Struts HTH, Ted http://www.StrutsMentor.com/ On Jan 16, 2008 8:56 PM, tzhang [EMAIL PROTECTED] wrote: I am doing some research ajax+struts2. you know struts2.0 has the built-in supprot for ajax based on Dojo, but I found the components is not very rich, only have some basic function. I know there are a lot of ajax components for JSF. So what did you do for struts2, develop your costom widgets or use the third party ajax library? If you use the third party ajax libray? Could you tell me which library is better? And give me some comments about how to integrate with struts2? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]