Este contenido no está disponible en el idioma seleccionado.
Chapter 2. Migration
2.1. Migrating from Seam 1.2.x to Seam 2.0 Copiar enlaceEnlace copiado en el portapapeles!
2.1.1. Migrating to JavaServer Faces 1.2 Copiar enlaceEnlace copiado en el portapapeles!
web.xml:
- Remove the MyFaces
StartupServletContextListener. - Remove the AJAX4JSF filter, mappings, and
org.ajax4jsf.VIEW_HANDLERScontext parameter. - Rename
org.jboss.seam.web.SeamFilterasorg.jboss.seam.servlet.SeamFilter. - Rename
org.jboss.seam.servlet.ResourceServletasorg.jboss.seam.servlet.SeamResourceServlet. - Change the
web-appversion from2.4to2.5. In the namespace URL, changej2eetojavaee. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
SeamFilter in web.xml instead of explicitly declaring SeamExceptionFilter and SeamRedirectFilter in web.xml.
javax.faces.STATE_SAVING_METHOD context parameter.
faces-config.xml:
- Remove the
TransactionalSeamPhaseListenerorSeamPhaseListenerdeclaration, if in use. - Remove the
SeamELResolverdeclaration, if in use. - Change the
SeamFaceletViewHandlerdeclaration to the standardcom.sun.facelets.FaceletViewHandler, and ensure it is enabled. - Remove the Document Type Declaration (DTD) from the document and add the XML Schema declarations to the
<faces-config>root tag, like so:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.1.2. Code Migration Copiar enlaceEnlace copiado en el portapapeles!
- Persistence-related components have been moved to
org.jboss.seam.persistence. - jBPM-related components have been moved to
org.jboss.seam.bpm. - JSF-related components, most notably
org.jboss.seam.faces.FacesMessages, have been moved toorg.jboss.seam.faces. - Servlet-related components have been moved to
org.jboss.seam.web. - Components related to asynchronicity have been moved to
org.jboss.seam.async. - Internationalization-related components have been moved to
org.jboss.seam.international. - The Pageflow component has been moved to
org.jboss.seam.pageflow. - The Pages component has been moved to
org.jboss.seam.navigation.
- BPM-related annotations are now included in the
org.jboss.seam.annotations.bpmpackage. - JSF-related annotations are now included in the
org.jboss.seam.annotations.facespackage. - Interceptor annotations are now included in the
org.jboss.seam.annotations.interceptpackage. - Annotations related to asynchronicity are now included in the
org.jboss.seam.annotations.asyncpackage. @RequestParameteris now included in theorg.jboss.seam.annotations.webpackage.@WebRemoteis now included in theorg.jboss.seam.annotations.remotingpackage.@Restrictis now included in theorg.jboss.seam.annotations.securitypackage.- Exception handling annotations are now included in the
org.jboss.seam.annotations.exceptionpackage. - Use
@BypassInterceptorsinstead of@Intercept(NEVER).
2.1.3. Migrating components.xml Copiar enlaceEnlace copiado en el portapapeles!
components.xml with the new schemas and namespaces.
org.jboss.seam.foobar. The new namespace format is http://jboss.com/products/seam/foobar, and the schema is of the form http://jboss.com/products/seam/foobar-2.0.xsd. You will need to update the format of the namespaces and schemas in your components.xml file so that the URLs correspond to the version of Seam that you wish to migrate to (2.0 or 2.1).
- Replace
<core:managed-persistence-context>with<persistence:managed-persistence-context>. - Replace
<core:entity-manager-factory>with<persistence:entity-manager-factory>. - Remove
conversation-is-long-runningparameter from<core:manager/>element. - Remove
<core:ejb/>. - Remove
<core:microcontainer/>. - Replace
<core:transaction-listener/>with<transaction:ejb-transaction/>. - Replace
<core:resource-bundle/>with<core:resource-loader/>.
Example 2.1. components.xml Notes
components.xml instead of a JSF phase listener declaration in faces-config.xml. To disable Seam-managed transactions, use the following:
<core:init transaction-management-enabled="false"/>
<core:init transaction-management-enabled="false"/>
expression attribute on event actions has been deprecated in favour of execute. For example:
org.jboss.seam.security> prefix instead of org.jboss.seam (for example, org.jboss.seam.security.notLoggedIn.)
Note
org.jboss.seam.postAuthenticate event, use the org.jboss.seam.security.loginSuccessful event to return to the captured view.
2.1.4. Migrating to Embedded JBoss Copiar enlaceEnlace copiado en el portapapeles!
- the
jars in Seam'slib/directory - the
bootstrap/directory
embeddded-ejb directory and jboss-beans.xml. (You can use the Seam examples as reference.)
Note
-ds.xml file, so the jboss-beans.xml file is no longer required.
2.1.5. Migrating to jBPM 3.2 Copiar enlaceEnlace copiado en el portapapeles!
tx service to jbpm.cfg.xml:
<service name="tx" factory="org.jbpm.tx.TxServiceFactory" />
<service name="tx" factory="org.jbpm.tx.TxServiceFactory" />
2.1.6. Migrating to RichFaces 3.1 Copiar enlaceEnlace copiado en el portapapeles!
ajax4jsf.jar and richfaces.jar jars have been replaced with the richfaces-api.jar (to be placed in the EAR lib/ directory) and the richfaces-impl.jar and richfaces-ui.jar (to be placed in WEB-INF/lib).
<s:selectDate> has been deprecated in favour of <rich:calendar>. There will be no further development of <s:selectDate>. The styles associated with the data picker should be removed from your style sheet to reduce bandwidth use.
2.1.7. Changes to Components Copiar enlaceEnlace copiado en el portapapeles!
All dependencies that were previously declared as modules in application.xml should now be placed in the lib/ directory of your EAR, except jboss-seam.jar, which should be declared as an EJB module in application.xml.
<s:decorate> has become a naming container. Client IDs have therefore changed from fooForm:fooInput to fooForm:foo:fooInput, assuming that the following has been declared:
<h:form id="fooForm">
<s:decorate id="foo">
<h:inputText id="fooInput" value="#{bean.property}"/>
</s:decorate>
</h:form>
<h:form id="fooForm">
<s:decorate id="foo">
<h:inputText id="fooInput" value="#{bean.property}"/>
</s:decorate>
</h:form>
<s:decorate>, JSF will generate an ID automatically.
Since Seam 2.0.0.CR2, there have been changes to the organization of generated classes in seam-gen when generate-entities is executed.
src/model/com/domain/projectname/model/EntityName.java
src/action/com/domain/projectname/model/EntityNameHome.java
src/action/com/domain/projectname/model/EntityNameList.java
src/model/com/domain/projectname/model/EntityName.java
src/action/com/domain/projectname/model/EntityNameHome.java
src/action/com/domain/projectname/model/EntityNameList.java
src/model/com/domain/projectname/model/EntityName.java
src/action/com/domain/projectname/action/EntityNameHome.java
src/action/com/domain/projectname/action/EntityNameList.java
src/model/com/domain/projectname/model/EntityName.java
src/action/com/domain/projectname/action/EntityNameHome.java
src/action/com/domain/projectname/action/EntityNameList.java
action package. This makes generate-entities conventions consistent with those of the new-entity command.
build.xml file as a base for new projects. If you have made extensive changes to the build.xml, you can focus on migrating only test-related targets.
<datasource> element in resources/META-INF/persistence-test.xml (or persistence-test-war.xml) to java:/DefaultDS. Alternatively, you can deploy a -ds.xml file to the bootstrap/deploy folder and use the JNDI name defined in that file.
build.xml as described, you will also require the deployed-*.list files, which define the jar files that are packaged in the EAR or WAR archive. These were introduced to remove the jar set from the build.xml file.
generate-entities, the search criteria block will bleed into the results table.
.rich-stglpanel-body {
overflow: auto;
}
.rich-stglpanel-body {
overflow: auto;
}