This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer (Exam 1Z0-830) Java SE 17 Developer (Exam 1Z0-829) Programmer’s Guide and have Khalid Mughal and Vasily Strelnikov on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

How to using DWR with Struts?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to using DWR with Struts?
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
DWR and Struts are not directly related.
Struts will return the view page. Once you have the view page, you can call the java script which inturn calls dwr servlet.
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are interesting in finding out more about using DWR with a Struts 1.x application, there have been various threads over on the Struts forum. Here is one that is a little old but has some good info (especially the posts by Merrill Higginson):

https://coderanch.com/t/53656/Struts/Ajax-struts-integration

DWR seems to be one of the best frameworks for adding in Ajax behavior with Struts 1.x. I have only played with DWR a little...my project uses AjaxAnywhere.

- Brent
 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're talking about Struts 1, then you can of course have DWR in the mix, but it's a little bit ackward. I have an application that was built that way in production, and what it basically comes down to is you let Struts handle the overall page flow, which tends to not happen nearly as much in any AJAX application anyway, and then DWR kind of handles events for a given page. That works reasonably well, but it's not ideal either because you could do it all with DWR and have simpler code.

If you're talking Struts 2, things *can* be a little different because Actions in S2 are often times POJOs, which DWR can actually instantiate and call methods on. I've never personally done this other than some playing around, but it seems like there would be some limitations involved (i.e., any knowledge of S2 from the Action may not work, HTTP* objects woul dhave to be accounted for, etc), but in theory it should work alright.
 
Ranch Hand
Posts: 1327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so does the latest version of DWR supports direct integration with Struts 2 or it requires some tweaking?
 
Frank Zammetti
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It requires some tweaking, that's my understanding. That'd be a good question to toss up on the DWR mailing list, see where that support really stands today.
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I integrated Struts 1.2.7 with DWR 2.0.3 using Spring 2.0.3 dwr tags
 
reply
    Bookmark Topic Watch Topic
  • New Topic