이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 2. Migration
2.1. Migrating from Seam 1.2.x to Seam 2.0 링크 복사링크가 클립보드에 복사되었습니다!
2.1.1. Migrating to JavaServer Faces 1.2 링크 복사링크가 클립보드에 복사되었습니다!
web.xml
:
- Remove the MyFaces
StartupServletContextListener
. - Remove the AJAX4JSF filter, mappings, and
org.ajax4jsf.VIEW_HANDLERS
context parameter. - Rename
org.jboss.seam.web.SeamFilter
asorg.jboss.seam.servlet.SeamFilter
. - Rename
org.jboss.seam.servlet.ResourceServlet
asorg.jboss.seam.servlet.SeamResourceServlet
. - Change the
web-app
version from2.4
to2.5
. In the namespace URL, changej2ee
tojavaee
. 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
TransactionalSeamPhaseListener
orSeamPhaseListener
declaration, if in use. - Remove the
SeamELResolver
declaration, if in use. - Change the
SeamFaceletViewHandler
declaration 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 링크 복사링크가 클립보드에 복사되었습니다!
- 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.bpm
package. - JSF-related annotations are now included in the
org.jboss.seam.annotations.faces
package. - Interceptor annotations are now included in the
org.jboss.seam.annotations.intercept
package. - Annotations related to asynchronicity are now included in the
org.jboss.seam.annotations.async
package. @RequestParameter
is now included in theorg.jboss.seam.annotations.web
package.@WebRemote
is now included in theorg.jboss.seam.annotations.remoting
package.@Restrict
is now included in theorg.jboss.seam.annotations.security
package.- Exception handling annotations are now included in the
org.jboss.seam.annotations.exception
package. - Use
@BypassInterceptors
instead of@Intercept(NEVER)
.
2.1.3. Migrating components.xml 링크 복사링크가 클립보드에 복사되었습니다!
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-running
parameter 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
action
s 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 링크 복사링크가 클립보드에 복사되었습니다!
- the
jar
s 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 링크 복사링크가 클립보드에 복사되었습니다!
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 링크 복사링크가 클립보드에 복사되었습니다!
ajax4jsf.jar
and richfaces.jar
jar
s 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 링크 복사링크가 클립보드에 복사되었습니다!
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;
}