Hi karen, yes, the way You described it, should work without any problems.
Best greetings, Paweł Wielgus. 2009/11/6 karen <leftka...@sina.com>: > Hello, all > > > > I want to use struts2.0.14 but I’m a beginner. > > I want to return xml to the browser, If I return null in the execute method > of an action, is there any ban consequence? I need some advice. > > I just want it this way: > > > > In my action: > > public String execute() throws Exception{ > > > > PrintWriter pw = null; > > response.setContentType(“text/xml;charset=GBK”); > > reponse.setHeader(“Cache-Control”, “no-cache”); > > try{ > > pw = response.getWriter(); > > pw.print(“<root><child>Lucy</child></root>”); > > } catch (IOException e) { > > e.printStackTrace(); > > } finally { > > pw.close(); > > pw = null; > > } > > > > return null; > > > > } > > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org