Can we invoke ATG FormHandler thu AJAX ?Do I have a hope ?
4 Answers
Generally: Yes :-)
But the possibilities may be limited or require some weird hacks to get them running, so it may depend on what exactly you want to do.
There are several different approaches:
You cannot directly send requests to a form handler, like you could do it with a servlet or a controller in frameworks like Struts or Spring MVC, but instead you always have to have a form in the JSP page (created using the DSP taglib), and then submit that form. This means that you cannot trigger a form handler without having an according form for it in your JSP page. But if you have that form in your page, you can submit it via an AJAX request. Your AJAX request will then trigger the form handler and get the result back, in the same way as a normal form submission would. This approach is possible and generally works. If you don't want to have a form for your AJAX request visible in the page, you could hide it e.g. using CSS.
Another approach would be using ATG'S REST Web Services module, which allows you to expose any component as a RESTful web service. This also allows you to invoke form handlers without the need to have a form for them or first render a JSP page. The document titled "ATG Web Services and Integration Framework Guide" (from Oracle's ATG documentation) has a whole chapter on how to invoke a form handler as a REST Web Service.
Or you could write a small custom servlet that receives your AJAX request and then uses the received data to invoke the form handler, just like it would lookup and invoke any other Nucleus component...

- 2,498
- 1
- 15
- 6
I have done this using APIs.
You need to use APIs to populate the form data required and then call the handle method from the API. You can use ATG's REST APIs or Spring if you want.

- 1,231
- 4
- 19
- 28
Just make a simple JSP no need of complex code to call handle method,create a JSP and just add the dsp:setvalue tag and the bean attribute should point to your handle Method ,now call this JSP through simple ajax
<dsp:setvalue bean="TestFormahandler.submit" value="" />
this will invoke the handleSubmit of formhandler
and there is always a hope friend :)

- 11
- 2