Announcement Announcement Module
Collapse
No announcement yet.
XML data sent to an AbstractController does not get received Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • XML data sent to an AbstractController does not get received

    Hi,

    I have an application that is sending XML data to an AbstractController. The controller is to read the data and write it to disk. What's happening is the file is always blank. No error is thrown.

    I used the same method to read XML data in a servlet with no issues. It doesn't work in AbstractController.

    In handleRequestInternal(HttpServletRequest request, HttpServletResponse response), I do the following:

    BufferedReader reader = request.getReader();
    BufferedWriter writer = new BufferedWriter(new FileWriter("C:\myfile.txt"));

    String line = null;

    while ((line = reader.readLine()) != null) {
    writer.write(line.trim());
    }
    writer.close();
    reader.close();

    In the servlet, I have the exact same code only I have doGet and doPost call processRequest(HttpServletRequest request, HttpServletResponse response).

    The servlet writes a nonempty file (correct) and the AbstractController creates an empty file.

    I confirmed the XML data is being sent.

    Any help would be greatly appreciated. Thanks!
Working...
X