Category: AJAX

Tip: how to write an XML document with JSP for AJAX applications 2

Tip: how to write an XML document with JSP for AJAX applications

AJAX applications usually connect to a server side application and request data in the form of XML. When the server side is written in JSP (Java Server Pages), for example a spring-framework web application with JSP views, writing the XML response is sometimes problematic.

The problem:

When using JSP to format the data in to XML and send it to the AJAX application, the XML is not recognized as XML (empty DOM object) and the AJAX application does not function properly.