JBoss Seam

来自开放百科 - 灰狐
(版本间的差异)
跳转到: 导航, 搜索
(Links)
 
(未显示4个用户的5个中间版本)
第69行: 第69行:
 
Seam 2.0是针对JavaServer Faces 1.2开发的,所以我们推荐在JBoss 4.2下使用Seam,因为它包含了JSF 1.2参考实现。  
 
Seam 2.0是针对JavaServer Faces 1.2开发的,所以我们推荐在JBoss 4.2下使用Seam,因为它包含了JSF 1.2参考实现。  
 
* Ensure that you have JDK 5.0 or above and Ant 1.6 properly installed (not Ant 1.7 beta).
 
* Ensure that you have JDK 5.0 or above and Ant 1.6 properly installed (not Ant 1.7 beta).
* For [http://labs.jboss.com/portal/jbossseam/download/index.html Seam 1.1.0.GA], download [http://sourceforge.net/project/showfiles.php?group_id=22866&package_id=193295&release_id=457191 JEMS installer 1.2.0.BETA3] and install JBoss AS 4.0.5 with the ejb3 profile selected. Do not install any other version of JBoss, and do not try to install JBoss using any other profile, not even the all profile.
+
* For [http://labs.jboss.com/portal/jbossseam/download/index.html Seam 1.1.0.GA], download [http://sourceforge.net/project/showfiles.php?group_id=22866&package_id=193295&release_id=457191 JEMS installer 1.2.0.BETA3] and install JBoss AS 4.0.5 with the ejb3 profile selected. Do not install any other version of JBoss, and do not try to install JBoss using any other profile, not even the <span class="plainlinks">[http://www.great-quotes.com/quotes/author/William/Shakespeare<span style="color:black;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">Shakespeare and his quotes</span>] all profile.
 
* Start JBoss AS with the bin/run.(sh|bat) script.
 
* Start JBoss AS with the bin/run.(sh|bat) script.
 
* Download Seam and unpack it.
 
* Download Seam and unpack it.
第158行: 第158行:
 
[[Category:Java]]
 
[[Category:Java]]
 
[[Category:JBoss]]
 
[[Category:JBoss]]
 +
[[category:event]]

2013年1月4日 (五) 02:56的最后版本

Wikipedia-35x35.png 您可以在Wikipedia上了解到此条目的英文信息 JBoss Seam Thanks, Wikipedia.

JBoss Seam是一种企业级Java的应用程序框架。

目标:Seam、JSF和EJB3的组合就是用Java编写复杂Web应用程序的最简单办法。

目录

[编辑] 新闻

自http://planet.jboss.org/xml/jbossseam?type=atom加载RSS失败或RSS源被墙

[编辑] 原则

它的灵感源自下列原则:

  • 只有一种“工具”
  • 将JSF与EJB 3.0整合
  • 集成Ajax
  • 将业务流程作为首要的基础建筑
  • 声明式状态管理
  • Bijection(双向注入)
  • 工作区管理(Workspace Management)和多窗口浏览
  • 更喜欢XML注解
  • 集成测试轻而易举
  • 规范也非尽善尽美
  • Web应用程序不只是服务HTML页面

[编辑] Functions

Jboss seam architecture.png
  • Integrate JSF with EJB 3.0
  • Integrated AJAX
  • Integrate BPM: jBPM
  • Seam component
  • Declarative State Management
  • Bijection
  • Workspace Management
  • Annotated POJOs Everywhere
  • Testability as a Core Feature
Configuring Seam in Java EE 5

[编辑] Seam contexts

  • Stateless context
  • Event (or request) context
  • Page context
  • Conversation context
  • Session context

In a JSR-168 portal environment, the session context represents the portlet session.

  • Business process context
  • Application context

Seam stores its own configuration and metamodel in the application context.

[编辑] Seam component types

  • EJB 3.0 stateless session beans
  • EJB 3.0 stateful session beans
  • EJB 3.0 entity beans
  • JavaBeans
  • EJB 3.0 message-driven beans

[编辑] Seam events

  • JSF events
  • jBPM transition events
  • Seam page actions
  • Seam component-driven events
  • Seam contextual events

[编辑] Pageflow in Seam

There are two ways to define pageflow in Seam:

  • Using JSF navigation rules - the stateless navigation model
  • Using jPDL - the stateful navigation model

[编辑] install guide

Seam 2.0是针对JavaServer Faces 1.2开发的,所以我们推荐在JBoss 4.2下使用Seam,因为它包含了JSF 1.2参考实现。

  • Ensure that you have JDK 5.0 or above and Ant 1.6 properly installed (not Ant 1.7 beta).
  • For Seam 1.1.0.GA, download JEMS installer 1.2.0.BETA3 and install JBoss AS 4.0.5 with the ejb3 profile selected. Do not install any other version of JBoss, and do not try to install JBoss using any other profile, not even the Shakespeare and his quotes all profile.
  • Start JBoss AS with the bin/run.(sh|bat) script.
  • Download Seam and unpack it.
  • Edit build.properties in your Seam directory and configure the path to your JBoss AS installation directory.
  • In the jboss-seam/examples/booking directory, type ant deploy and check for any error messages.
  • Point your browser to http://localhost:8080/seam-booking/ and register an account.
  • In the jboss-seam/examples/dvdstore directory, type ant deploy and check for any error messages.
  • Point your browser to http://localhost:8080/seam-dvd/ and register an account.
  • In the jboss-seam/examples/issues directory, type ant deploy and check for any error messages.
  • Point your browser to http://localhost:8080/seam-issues/ and register an account.
  • Change the pages and/or source code in your the jboss-seam/examples/booking directory and redeploy the application by calling ant deploy - see how your modifications affect the application.

[编辑] Seam tools

http://docs.jboss.com/seam/1.0.0.GA/reference/en/html/tools.html

[编辑] seam-gen

cd jboss-seam-2.2.x

seam setup // 设置seam环境
seam new-project // 创建一个新项目
seam new-action // 创建一个新action
seam new-form  // 创建一个新form
seam generate-entities // 从存在的数据库生成一个应用
seam generate-ui // 从存在的JPA/EJB3 entities生成一个应用

[编辑] Database

[编辑] PostgreSQL

persistence.xml

<jta-data-source>java:/blogDatasource</jta-data-source>

blog-ds.xml

    <local-tx-datasource>
       <jndi-name>blogDatasource</jndi-name>
       <connection-url>jdbc:postgresql://localhost/seam</connection-url>
       <driver-class>org.postgresql.Driver</driver-class>
       <user-name>seam</user-name>
       <password>seam</password>
   </local-tx-datasource>   

/deploy/postgresql-ds.xml

<datasources>
   <local-tx-datasource>
   <jndi-name>PostgresDS</jndi-name>
   <connection-url>jdbc:postgresql://localhost:5432/seam</connection-url>
   <driver-class>org.postgresql.Driver</driver-class>
   <user-name>seam</user-name>
   <password>seam</password>
   <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.PostgreSQLValidConnectionChecker</valid-connection-checker-class-name>
   <metadata>
   <type-mapping>postgresql</type-mapping>
   </metadata>
   </local-tx-datasource>
</datasources>

添加 postgresql-8.3-603.jdbc4.jar 到 jboss-5\common\lib 注意要重启 server

[编辑] MySQL

/deploy/mysql-ds.xml

<datasources>
   <local-tx-datasource>
   <jndi-name>MySQLDS</jndi-name>
   <connection-url>jdbc:mysql://localhost:3306/test</connection-url>
   <driver-class>com.mysql.jdbc.Driver</driver-class>
   <user-name>root</user-name>
   <password>huihoo</password>
   <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name>
   <metadata>
   <type-mapping>mySQL</type-mapping>
   </metadata>
   </local-tx-datasource>
</datasources>

[编辑] Code

Developing Seam using IntelliJ IDEA Idea-seam.png

Seam Svn Repository http://seamframework.org/Download/SeamDownloads#H-SeamSVNRepository

[编辑] Powered by

[编辑] Documents

[编辑] Links

Comment-32x32.png

<discussion>characters_max=300</discussion>

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱