Top Spring WebFlow Interview Questions (2021) | CodeUsingJava
















Most frequently asked Spring WebFlow Interview Questions


  1. What is Spring web flow?
  2. What are the advantags of Webflux?
  3. What are the features of Spring Webflux?
  4. How to use multiple ViewResolvers in Spring?
  5. Name the different variable scopes in Spring WebFlow?
  6. Difference between Spring MVC and Webflux?
  7. What are "Actions" in Spring Webflow?
  8. Explain Simple Variable in Web Flow?
  9. What is the meaning of flow?
  10. What are the several points where we can execute actions?
  11. How does a Bean LifeCycle works?
  12. What are different components of flow definition?
  13. When is Spring Web Flow right for us to use?


What is Spring web flow?

Spring Webflow helps us in implementing the flows of a web application and is build on Spring MVC.It is dynamic and long running in nature, also provides a higher level of abstraction.It also helps in dealng with transactional data and is resuable.
Spring Webflux allows to be integrated into a wide range of applications without going through any changes including Spring MVC, JSF, and even Portlet web applications.

What are the advantags of Webflux?

Better work flow management
Uses same consistent technique
Avoids browser buttons
Continuations flow of Execution Repository
Covers unit testing
Can reuse multiple situations


What are the features of Spring Webflux?

  • High Scalibility
  • Provides immune to latency
  • Provides better stream processing capabilities

How to use multiple ViewResolvers in Spring?

For using multiple ViewResolvers, we have to write simple custom implementation of ViewResolver and decides which of the view resolvers to delegate to.

public class MyViewResolver implements ViewResolver {

    private ViewResolver tilesResolver;
    private ViewResolver jspResolver;

    public void setJspResolver(ViewResolver jspResolver) {
        this.jspResolver = jspResolver;
    }

    public void setTilesResolver(ViewResolver tilesResolver) {
        this.tilesResolver = tilesResolver;
    }

    public View resolveViewName(String viewName, Locale locale) throws Exception {
        if (isTilesView(viewName)) {
            return tilesResolver.resolveViewName(viewName, locale);
        } else {
            return jspResolver.resolveViewName(viewName, locale);
        }
    }

    private boolean isTilesView(String viewName) {
    .....
    }
}


Name the different variable scopes in Spring WebFlow?

Flow Scope
View Scope
Request Scope
Flash Scope
Conversation Scope


Difference between Spring MVC and Webflux?


Webflux


What are "Actions" in Spring Webflow?

Actions are typical encapsulating that represents tasks with business logic, that need to be executed on certain points to achieve the desired result.

Explain Simple Variable in Web Flow?

We can define it at flow definition level and expose it to the view directly:
<on-entry>
   <set name="flowScope.myView" value="flowRequestContext.currentState.id"/>
</on-entry>


What is the meaning of flow?

Flow is a reusable sequence of steps in different contexts.

flow


What are the several points where we can execute actions?

These points are:
  • On flow start
  • On state entry
  • On view render
  • On transition execution
  • On state exit
  • On flow end

How does a Bean LifeCycle works?


flow

We can use seven steps to the Bean lifecycle:
Instantiate
Populate properties
Set Bean Name
Set Bean factory
Pre Initialization
Initialization
Post Initialization


What are different components of flow definition?

The components of flow are:
Root element
View State
Transition State
End State


When is Spring Web Flow right for us to use?

Spring Web Flow right for use in:
Booking a flight
Paying our taxes
Applying for a loan