Results 1 to 3 of 3

Thread: HandlerInterceptor equivalent in Webflow

  1. #1
    Join Date
    Jan 2010
    Posts
    9

    Question HandlerInterceptor equivalent in Webflow

    Hi guys,

    please help a total webflow/jsf noob out!

    I'm looking for a way to get the same functionality as with a HandlerInterceptor in Spring MVC.
    That is, I want to do some checks before the flow starts, possibly redirecting to an error site,
    store something in a session scoped bean and write to a logging table after the request.

    In our MVC application, I used a HandlerInterceptor to filter out invalid characters and do some logging
    after the controller ended.

    My HandlerInterceptor doesn't get called by JSF/Webflow.
    I tried a OncePerRequestFilter, but it didn't get my beans wired into it.

    So, how can I do this in webflow?

    Thanks a lot!

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    If it doesn't get called you have a problem in your configuration. You can easily (re)use HandlerInterceptors for web flow. There is a catch however as spring web flow has it's own view handling/resolving mechanism changes to the modelandview (which probably is going to be null) don't work as the rendering etc. is already done in the postHandle method.

    If you want a filter use a DelegatingFilterProxy that allows you to configure the filter in an application context.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Jan 2010
    Posts
    9

    Default

    Thank you very much, Marten!

    Quote Originally Posted by Marten Deinum View Post
    If it doesn't get called you have a problem in your configuration. You can easily (re)use HandlerInterceptors for web flow.
    Great! I didn't find this information anywhere. I will look over my config again.


    Quote Originally Posted by Marten Deinum View Post
    There is a catch however as spring web flow has it's own view handling/resolving mechanism changes to the modelandview (which probably is going to be null) don't work as the rendering etc. is already done in the postHandle method.
    This will be no problem as I don't need to modify the model, I just need access to a DAO and a request scoped bean at that point.

    Quote Originally Posted by Marten Deinum View Post
    If you want a filter use a DelegatingFilterProxy that allows you to configure the filter in an application context.
    Thank you, I will look into that!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •