You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlrpc-dev@ws.apache.org by Thankful Novice <bo...@yahoo.com> on 2007/08/03 06:23:58 UTC
Servlet Filter can't effect XML-RPC reply
I am using XML-RPC and am trying to use a ServletFilter to handle transaction
code. The problem I am seeing is that the reponse is sent before control is
returned to the filter. Below is a code sample where the filter throws and
exception but this happens after the responce and the client has already
continued on. Is there a way to overcome/handle this?
thanks in advance.
public void doFilter(ServletRequest servletRequest, ServletResponse
servletResponse,
FilterChain filterChain) throws IOException,
ServletException {
System.out.println("********** TestServletFilter called
**********");
// Call the next filter (continue request processing)
filterChain.doFilter(servletRequest, servletResponse);
throw new RuntimeException("Boom from servlet filter");
}
--
View this message in context: http://www.nabble.com/Servlet-Filter-can%27t-effect-XML-RPC-reply-tf4210537.html#a11977269
Sent from the Apache Xml-RPC - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org
Re: Servlet Filter can't effect XML-RPC reply
Posted by Jochen Wiedmann <jo...@gmail.com>.
On 8/3/07, Thankful Novice <bo...@yahoo.com> wrote:
>
> I am using XML-RPC and am trying to use a ServletFilter to handle transaction
> code. The problem I am seeing is that the reponse is sent before control is
> returned to the filter. Below is a code sample where the filter throws and
> exception but this happens after the responce and the client has already
> continued on. Is there a way to overcome/handle this?
A servlet filter isn't the recommended tool of choice. I'd personally
use my own handler mapping. That handler mapping would invoke the
actual handlers via reflection and the logic for transaction handling
would sit around the reflection call.
Jochen
--
"Besides, manipulating elections is under penalty of law, resulting in
a preventative effect against manipulating elections.
The german government justifying the use of electronic voting machines
and obviously believing that we don't need a police, because all
illegal actions are forbidden.
http://dip.bundestag.de/btd/16/051/1605194.pdf
---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org