• 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 Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

AJAX with WebWork or Struts

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i want to use AJAX in my web application. at present i am using free marker, webwork,spring and hibernate together. i found various example of using AJAX with other technologies. what i wan to know is that what changes should i make in my xwork.xml so that i can handle ajax request. i also want to know how should i send response from my Action to AJAX request.
i know how to use AJAX with simple servlet doget, dopost methods. but if any body can help me or show me simple example to use it with web work than it will be great.
thanks in advance.
Vikas
 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

what i wan to know is that what changes should i make in my xwork.xml so that i can handle ajax request


You don't have to do anything special at all, just define your action as usual.

i know how to use AJAX with simple servlet doget, dopost methods. but if any body can help me or show me simple example to use it with web work than it will be great.


With WebWork, there is no difference at all.
All what you can do with raw Servlets you can do with WebWork action.

 
vikas prasad
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
but the problem is after the action runs, and it maps to :
<action name="admission" class="frontPageAction" method="aboutUs">
<result name="success" type="freemarker">
<param name="location">/template/home/content/Admission.ftl</param>
</result>
</action>

parameter as defined in my result. it reloads the page. i think do i need to use simple servlet dopost methods or doget methods where i dont return any thing. then it will work.
because when we return Success in my execute method it maps to the param that i have defined. i my Xwork.
so is there any other way i can do this
 
Hussein Baghdadi
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

i think do i need to use simple servlet dopost methods or doget methods where i dont return any thing.


If you don't return any thing, why you are using Ajax?
The most basic use of Ajax is to update parts of the page.

parameter as defined in my result. it reloads the page.


What is the type of your result, forward or redirect?
I think you have to set it forward (if it not already is).
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic