下载:jboss-seam-2.2.0.GA
cd jboss-seam-2.2.x
seam setup,用来设置一些基本的参数,JBoss AS的安装路径,数据库连接等等,首次设定好以后,以后就可以据此来生成项目。
现在我们可以在我们的Eclipse工作区目录下创建一个新的项目,输入:
seam new-project
这个命令的具体动作请参见如下内容:
This copies the Seam jars, dependent jars and the JDBC driver jar to a new Eclipse project, and generates all needed resources and configuration files, a facelets template file and stylesheet, along with Eclipse metadata and an Ant build script. The Eclipse project will be automatically deployed to an exploded directory structure in JBoss AS as soon as you add the project using New -> Project... -> General -> Project -> Next, typing the Project name (helloworld in this case), and then clicking Finish. Do not select Java Project from the New Project wizard.
If your default JDK in Eclipse is not a Java SE 5 or Java SE 6 JDK, you will need to select a Java SE 5 compliant JDK using Project -> Properties -> Java Compiler.
Alternatively, you can deploy the project from outside Eclipse by typing seam explode.
在IE输入http://localhost:8080/helloworld 就可以看到欢迎页面.
This is a facelets page, view/home.xhtml, using the template view/layout/template.xhtml. You can edit this page, or the template, in Eclipse, and see the results immediately, by clicking refresh in your browser.
Don't get scared by the XML configuration documents that were generated into the project directory. They are mostly standard Java EE stuff, the stuff you need to create once and then never look at again, and they are 90% the same between all Seam projects. (They are so easy to write that even seam-gen can do it.)
The generated project includes three database and persistence configurations. The persistence-test.xml and import-test.sql files are used when running the TestNG unit tests against HSQLDB. The database schema and the test data in import-test.sql is always exported to the database before running tests. The myproject-dev-ds.xml, persistence-dev.xmland import-dev.sql files are for use when deploying the application to your development database. The schema might be exported automatically at deployment, depending upon whether you told seam-gen that you are working with an existing database. The myproject-prod-ds.xml, persistence-prod.xmland import-prod.sql files are for use when deploying the application to your production database. The schema is not exported automatically at deployment.
如果想获取中文文档,请参看本空间下载部分,已提供中文Jboss Seam文档+实例
本文介绍如何使用 JBoss Seam 2.2.0 GA 版本快速创建并部署 Eclipse 项目。通过 seamsetup 设置 JBoss AS 安装路径等基本信息后,使用 seamnew-project 命令自动生成项目结构及配置文件,并部署到 JBoss AS 中。文章还介绍了如何调整默认 JDK 版本,并提供了不同环境下的数据库配置说明。

291

被折叠的 条评论
为什么被折叠?



