Top JBoss Seam Interview Questions (2021) | CodeUsingJava
















Most frequently asked JBoss Seam Interview Questions


  1. What is JBoss Seam?
  2. Can we run Seam outside of JBoss AS?
  3. What do we set-up a cluster with JBoss?
  4. How to configure Seam Listener?
  5. Why should we use Seam?
  6. What are the components in Seam?
  7. How can we save all the session in a list in Seam?
  8. What is workspace management?
  9. How to refresh all fields in a form?
  10. Where to define Seam's core initialization component?
  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 JBoss Seam?

Seam is a powerful open source development platform for building rich Internet applications in Java. Seam integrates technologies such as Asynchronous JavaScript and XML (AJAX), JavaServer Faces (JSF), Java Persistence (JPA), Enterprise Java Beans (EJB 3.0) and Business Process Management (BPM) into a unified full-stack solution, complete with sophisticated tooling. Seam has been designed from the ground up to eliminate complexity at both architecture and API levels. It enables developers to assemble complex web applications using simple annotated Java classes, a rich set of UI components, and very little XML. Seam's unique support for conversations and declarative state management can introduce a more sophisticated user experience while at the same time eliminating common bugs found in traditional web applications. Seam can be stateful, with state associated with the conversation context, long-running context, business process context, persistent , which maintain state across multiple web requests in a user conversations. JBoss Seam is a platform for building internet applications in Java, it is designed to eleminate both architecture and API levels.It helps in developing complex web application by using simple annotated Java class.
JBoss Seam supports in conversation and declarative state management and can introduce more sophisticated users experience while eliminating comon bugs found in traditional web applications.
JBoss Seam can manage long running context, business process context, persistent, and state across multiple web requests in a user conversations.


Can we run Seam outside of JBoss AS?

Yes, you can run Seam applications in plain Tomcat 5.5+ or in the Sun GlassFish application server. To run Seam application in Tomcat, you need a number of additional library files and a few configuration files to bootstrap the JBoss EJB3 inside Tomcat. Please refer to the deploy.tomcat ANT build target for the Seam booking example (in the examples/booking directory of the Seam distribution) for more on how to build a Tomcat WAR for Seam applications. Refer to this blog post on how to run Seam in Sun's Glassfish application server. Yes, we can run seam outside JBoss AS as to run seam application in Tomcat we need a number of additional library files and also configuration files for bootstrap the JBoss EJB3 inside Tomcat.

What do we set-up a cluster with JBoss?

We can setup clusters with JBoss by using:
Groups.jar, jboss-cache.jar
Clustered beans
HA-JNDI
HTTP session replications
Farming
HA-JMS


How to configure Seam Listener?

<faces-config>
. . .
 <main>
  <phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener>
 </main>
. . .
</faces-config>


Why should we use Seam?

  • Easy way for getting started with EJB 3.0 - It is a great component for transactional business components, being the new Java persistence API.
  • Best way for leveraging JSF - As JSF does not address the provlem of access to transactional resources, Seam integration of JTA, JPA and EJB 3.0 is important for many JSF users.
  • Easy way for integrating jBPM deeply and making use of jBPM for task management or pageflow.
  • JBoss Seam have been developed for using with EJB 3.0 and also used anywhere with latest module framework.

What are the components in Seam?

JBoss seam components are Plain Old Java Objects.It supports the following components:
EJB 3.0 stateless session beans - Helps in operating upon the states of other components in the various Seam contexts.
EJB 3.0 stateful session beans - Helps by acting as JSF action listener.
EJB 3.0 message-driven beans - Helps in supporting bijection and some other Seam functionality.
EJB 3.0 entity beans - Helps in providing properties to JSF components for display.
JavaBeans - They can be used just like a stateless or stateful session bean.


How can we save all the session in a list in Seam?


public class SessionListener implements HttpSessionListener, java.io.Serializable{
    private static final Logger log = Logger.getLogger(SessionListener.class);
    public void sessionCreated(HttpSessionEvent event) {
        listsession.add(event.getSession());
    }

    public void sessionDestroyed(HttpSessionEvent event) {
        listsession.remove(event.getSession());
    }
}



What is workspace management?

Workspace management helps in switching conversation in single window, It is completely transparent at the level of the Java Code.
For enabling workspace management we need to:
Provide description text for each view id or page node. This description text is displayed to the user by the workspace switchers.
And include one or more of the standard workspace switcher JSF or Facelets fragments in your pages.As the fragments suppots workspace management through drop down menu, list of conversations and breadcrumbs.


How to refresh all fields in a form?

We can refresh all fields by using :
<a:support event="onchange" reRender="pessoaDocumentoIdentificacaoForm" oncomplete="hideLoading();" ajaxSingle="true" />


Where to define Seam's core initialization component?

Seam core initialization module entry must be included in Seam's components.xml:
<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://jboss.com/products/seam/components"
            xmlns:core="http://jboss.com/products/seam/core"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation=
                "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
                 http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">

    <core:init jndi-pattern="@jndiPattern@"/>

</components>