목요일, 3월 28
Shadow

#030 Java EE 6 Overrview & Getting Java EE 6 sample codes

Lab Exercises

Exercise 1: Get “glassfish-samples” examples from GlassFish v3 Update center

In this exercise, you are going to get “glassfish-samples” examples from GlassFish v3 update center.  The “glassfish-samples” contains many Java EE 5 and Java EE 6 examples in the form of “ready-to-run” NetBeans projects.

(1.1) Start GlassFish v3 update center

1. Install GlassFish v3 update center (if it has not been installed).


Figure-1.11


Figure-1.12

  Trouble-shooting Update Tool: For Mac X Users, it may happen that the Update Tool issues the following warning when you click on Available Add-ons.


Figure-1.tb1

To work around this issue:

  1. Close the Warning dialog box by clicking on OK.


    Figure-1.tb2

  2. Quit the Update Tool.
  3. Launch GlassFish by right clicking on GlassFish v3 in the Services tab and choose Start.


    Figure-1.tb3

  4. Launch the Admin Console by right clicking on GlassFish v3 in the Services tab and choose View Admin Console.


    Figure-1.tb4

  5. Eventually close the Register dialog box by clicking on Cancel.


    Figure-1.tb5

  6. Click on Available Add-ons.


    Figure-1.tb6

  7. From there, you will get a right panel very similar to the one obtained via the Update Tool, except that the name of the components are not humanized.
    Notice also that you will be not advertised from necessary dependencies, but that they will be added silently without needing to check them.


    Figure-1.tb7

  8. Once the add-ons have been installed, quit the Admin Console and restart GlassFish server.
  9. Repeat steps 3 to 8 for further installations

return to top of exercise

(1.2) Get “Java EE Sample Applications” (from the update center)

1. Get the “Java EE Sample Applications Full Profile” and “Java EE Sample Applications Web Profile”.

  • Select Available Add-ons on the left.
  • Check the checkboxes of the “Java EE Sample Applications Full Profile” and “Java EE Sample Applications Web Profile”.
      If you install via the Admin Console (Troubleshooting Update Tool) the names of the add-ons to be installed are
    javaee-samples-full and javaee-samples-web respectively.
  • Click Install icon.


Figure-1.21


Figure-1.22


Figure-1.23

  • Observe that the sample applications are installed under <GlassFish-v3-Installation-Directory>/glassfish/samples directory.

2. Open a sample project.


Figure-1.24

  • Browse down to <GlassFish-v3-Installation-Directory>/glassfish/samples directory.


Figure-1.25

  • Expand javaee6->web->servlet.
  • Select annotation-war and click Open Project.


Figure-1.26

  • Observe that the annotation-war NetBeans project is opened.


Figure-1.27

                                                                                                                    return to top of exercise

 

 

Exercise 2: Check out “Java EE 6 Tutorial” examples from GlassFish v3 update center

Another set of Java EE 6 sample projects can be retrieved through the GlassFish v3 update center.  These sample projects are the ones that are described in the “Java EE 6 Tutorial”.

(2.1) Install “Java EE 6 Tutorial”


Figure-2.11

  If you install via the Admin Console (Troubleshooting Update Tool) the name of the add-on to be installed is javaee-tutorial.


Figure-2.12

  • Observe that the sample applications are installed under <GlassFish-v3-Installation-Directory>/glassfish/docs/javaee-tutorial directory.
  • Close the GlassFish v3 Update center.

(2.2) Open a project

1. Open order project.


Figure-2.21

  • Observe that the order project is opened.


Figure-2.22


Figure-2.23


Figure-2.24

 

Exercise 3: Check out “glassfish-samples” examples

In this exercise, you are going to check out “glassfish-samples” projects.  The “glassfish-samples” contains many Java EE 5 and Java EE 6 examples in the form of “ready-to-run” NetBeans projects.

(3.1) Get an account from java.net

1. From your browser, go to https://www.dev.java.net/servlets/Join.
2. Follow the registration steps.


Figure-3.11

(3.2) Check out “glassfish-samples” module.

1. Start CVS checkout process.

  • Start NetBeans IDE (if you have not done so yet).
  • Selec Team from top-level menu and select CVS->Checkout.


Figure-3.21

2. Enter CVS root.

  • For the CVS Root field, enter :pserver:<your-java.net-account>@cvs.dev.java.net:/cvs
  • For the Password field, enter password of your java.net account.
  • Click Next.


Figure-3.22

3. Provide “module to check out” information.

  • For the Module field, enter glassfish-samples.
  • For the Local Folder field, enter a local directory of your choice.
  • Click Finish.


Figure-3.23

  • Observe that the files are being checked out.  It might take up to 20 minutes (or longer if your network is slow).


Figure-3.24

4. Open the project.  (You can open the project from the local CVS directory – C:\javaee6-samples\glassfish-samples\ws\javaee6\…)  You can open these projects later in the same way you open any NetBeans projects.

return to top of exercise

(3.3) Explore the project

1. Open the project.


Figure-3.31


Figure-3.32

  • Observe the opened project.


Figure-3.33

Homework Exercise (for people who are taking Sang Shin’s “Java EE Programming online course”)

 

There is no homework for this topic.

 

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

이 사이트는 스팸을 줄이는 아키스밋을 사용합니다. 댓글이 어떻게 처리되는지 알아보십시오.