views:

304

answers:

1

I am sending a XML in HTTP POST body.

Question:

  1. Does struts2 support processing request in utf-8 encoding?

Reference:

(Around bottom of the page)

+1  A: 

Yes you shouldn't have any problem, just define the enconding in your action when sending the stream to the view, in case you are using the stream result type.

STRUTS.XML
<result name="xml" type="stream">
<param name="inputName">inputStream</param>
</result>

ACTION
setInputStream(new ByteArrayInputStream(xmlObject.toString().getBytes("UTF-8")));
return "xml";
pedromarce