Rajeev Sharma wrote:
When I try to upload a file which is bigger then the max allowed size,
the file upload interceptor returns "input" and the control does not
come to the execute method of my action class. In this case I can
redirect the result to some JSP, to some other action etc, but how do I
return a xml response with the error description and some error code.
Hi Rajeev,
It sounds like you just want an action to return an XML result (for an
"input" result).
A very simple way to do that is return a JSP with contentType="text/xml".
in struts.xml:
<result name="input">failed.jsp</result>
in the failed.jsp:
<%@ page contentType="text/xml;charset=ISO-8859-1" %>
<?xml version="1.0" encoding="ISO-8859-1"?>
<message>Too big!</message>
You can use properties in your XML as you would with a JSP result.
There's also an XSLT result type available or you could use a Bean->XML
serializer like XStream.
Hope that helps,
Jeromy Evans
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]