Announcement Announcement Module
No announcement yet.
[LoginInterceptor] How to send response ? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • [LoginInterceptor] How to send response ?

    How to send back response to the client in an EndpointInterceptor without processing the endpoint ?

    Ex for a LoginInterceptor :
    request -> interceptor#login() -> "login failed" -> send response

    The handleRequest method return boolean. After a login failed should I return fasle, throw Exception ?

    Thansk for any help.

  • #2
    That depends on what you want to do. Returning false in the EndpointInterceptor.handleRequest method discontinues the invocation of any further interceptor in the invocation chain (and the endpoint) and triggers the response handling phase.

    A more natural way would be to throw an exception in your interceptor and to define an EndpointExceptionResolver in your application context that maps your exception to a SOAP fault (provided you're using SOAP of course).
    Check out the several implementations provided by Spring-WS. You can even implement your own if none suits your needs.