I am trying to implement ajax functionality in our web application which is based on struts 1.1.
I know how ajax works but not sure about the same in struts. I have below queries, could you please provide your inputs?
My requirement : Need to populate drop down values through ajax whenever user changes state and country on same page.
If I fire a action class via ajax, how should I write struts-config.xml? because on success there will be no forward page and do I need to include "ActionForward(mapping.findForward("success"))" in action class?
The best practice is: don't use Struts 1. Struts 2 is easier to use and has common AJAX functionality available as plugins (i.e. JSON results and jQuery AJAX controls).
That said, the answer to your question is "perhaps". If your action is writing the result directly to the client, you do not need to declare a result in struts-config.xml and your action should return null. On the other hand, a JSP can be used to create any text format so you can configure a result in struts-config.xml and use that JSP to return XML or JSON or whatever your client expects.