wood burning stoves*
The moose likes Struts and the fly likes Struts2 and ajax issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 and ajax issue" Watch "Struts2 and ajax issue" New topic
Author

Struts2 and ajax issue

Alex Acev
Greenhorn

Joined: Mar 28, 2009
Posts: 3
Hey all,
I'm not sure if anyone has run into this issue but if anyone can help would gladly appreciate. I am using Struts2 and prototype for this web application that I am developing. On the page I have some div's that get populated with html fragments from a jsp page after an AjaxRequest call. The html fragment that is returned to populate the div is just an html form asking a question. After the user selects submit an action is called where there is some validation done on the requests. If there is an error however when the page is returned I am only seeing the one question with html form fragment. I don't see the other questions. so I guess my question is is there a way to just refresh the div and not return a new page with just the one question. Can the struts.xml file call a javascript/AjaxRequest function so that only the div gets refreshed and not the whole page? Let me know if you need me to provide more information. Any help again would be appreciated. Thanks.






David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Ajax form submits can optionally refresh just a div: http://struts.apache.org/2.1.6/docs/dojo-submit.html
Alex Acev
Greenhorn

Joined: Mar 28, 2009
Posts: 3
Thanks for responding so promptly David. The link you provided deals with using the Dojo framework. I am currenlty using the prototype framework for this web app. Is refreshing just a div still possible if we are using the prototype framework and not dojo?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61092
    
  66

"ace ace", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Alex Acev
Greenhorn

Joined: Mar 28, 2009
Posts: 3
I guess no one has an answer to this one?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You can use whatever framework you want, but the Dojo tags work with Dojo. If you're using something non-Dojo then obviously the tags won't work, but you can still do things however you'd do things normally.
 
Consider Paul's rocket mass heater.
 
subject: Struts2 and ajax issue