Building Seam 2.0 Application with NetBeans 6.1 (MAVEN2)

Source: Internet
Author: User
Tags glassfish jboss netbeans

Building Seam 2.0 application with NetBeans 6.1 (MAVEN2)


Reprint please retain the author information:

author:88250

blog:http:/blog.csdn.net/dl88250

MSN & Gmail & qq:dl88250@gmail.com


Table of Contents

Introduction 1

Prerequisites 2

Seam Glimpse 2

Set Up Seammaven Application 3

Create Projects 3

Pom.xml of Seammaven 3

Pom.xml of Seammaven-ear 4

Pom.xml of SEAMMAVEN-EJB 5

Pom.xml of Seammaven-war 10

Application related configurations and sources 13

The end .... 13

References 14


Introduction

This article depicts you to build a simple registration application base on JBoss Seam 2.0 (JSF with Facelets, EJB3, JPA) u Sing NetBeans 6.1, and deploys it on Glassfish v2, MySQL 5.1.

To the demonstration building, I divide the IT content into two ways:

Using NetBeans built-in Project Wizard to create a enterprise application, which includes a EJB project and a Web Project. You can have the details here.

Using Maven for NetBeans plugin to create a enterprise application, also it includes a EJB project and a Web proj Ect. This entry would use this way to build the sample application.


Of these, would deploy on Glassfish V2 and use MySQL 5.1 Community Edition. As I mentioned formerly, this demo using Facelets framework for JSF View definition, the most important thing are it setup With the NetBeans IDE with MAVEN2 support and deploys on Glassfish v2. Although you maybe refer to jee-booking example into JBoss Seam tutorial, there are some practical issues you'll occur. So, Just follow me! :-)


Prerequisites

Java EE programming (JSF, EJB3, JPA)

Usage of NetBeans IDE 6.1 with Maven2

JBoss Seam Framework 2.0

Facelets

In this sample application, I use Facelets as JSF View definition framework, it are a very elegant presentation for JSF. Seam Glimpse

As we known, 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. The simple chart of architectural design'll show you about this:




The following demonstration'll show you a part of features Seam brought.


Set up Seammaven application

In this section, I'll mention some important notices of creating seam application using NetBeans IDE with Maven.


Create Projects

Open NetBeans IDE, and create a MAVEN application project, named Seammaven. Changes the packing to POM. Creates three MAVEN application project in Seammaven root directory, named Seammaven-ear, SEAMMAVEN-EJB, Seammaven-war, re Spectively. And, changes the packing to ear, EJB, war correspondingly.


Pom.xml of Seammaven

Modify your pom.xml like this:

<?xml version= "1.0" encoding= "UTF-8"?>

<project xmlns= "http://maven.apache.org/POM/4.0.0" xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance" xsi: schemalocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" >

<modelVersion>4.0.0</modelVersion>

<groupId>com.mycompany</groupId>

<artifactId>SeamMaven</artifactId>

<packaging>pom</packaging>

<version>1.0-SNAPSHOT</version>

<name>SeamMaven</name>

<url>http://maven.apache.org</url>

<modules>

<module>SeamMaven-ejb</module>

<module>SeamMaven-war</module>

<module>SeamMaven-ear</module>

</modules>

<build>

<plugins>

<plugin>

<artifactId>maven-compiler-plugin</artifactId>

<version>2.0.2</version>

<configuration>

<source>1.6</source>

<target>1.6</target>

</configuration>

</plugin>

</plugins>

</build>

<repositories>

<repository>

<id>repository.jboss.org</id>

<name>jboss repository</name>

<url>http://repository.jboss.org/maven2</url>

</repository>

<repository>

<id>maven.search</id>

<name>maven Search org</name>

<url>http://www.mvnsearch.org/maven2</url>

</repository>

<repository>

<id>maven.java.net</id>

<name>java.net Maven2 repository</name>

<url>http://download.java.net/maven/2</url>

</repository>

</repositories>

</project>


Pom.xml of Seammaven-ear

Modify your pom.xml like this:

<?xml version= "1.0" encoding= "UTF-8"?>

<project>

<parent>

<artifactId>SeamMaven</artifactId>

<groupId>com.mycompany</groupId>

<version>1.0-SNAPSHOT</version>

</parent>

<modelVersion>4.0.0</modelVersion>

<groupId>com.mycompany</groupId>

<artifactId>SeamMaven-ear</artifactId>

<name>SeamMaven-ear</name>

<packaging>ear</packaging>

<version>1.0-SNAPSHOT</version>

<url>http://maven.apache.org</url>

<dependencies>

<!--JBoss Seam-->

<dependency>

<groupId>org.jboss.seam</groupId>

<artifactId>jboss-seam</artifactId>

<version>2.0.3.CR1</version>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.