Lab #3 (Additional Seam Commands)
Overview
Seam has additional commands that provide code generation for your application.
While the new EJB3 constructs are simpler than EJB2, there is still significant
value in using code generation. There is also support for the creation of facelet
forms. In this lab, we will execute
the following commands:
- seam new-conversation
- Creates a new Stateful Session Bean and facelet HTML form.
- seam explode
- Copies a Seam EAR or any EAR changes as an exploded archive to the server
deployment directory.
- seam restart
- Tells the application server to re-deploy the exploded Seam EAR (Only
needed on changes to Java classes)
Lab Instructions
- Switch seam-gen to the helloworld-lab3 project
- type: cd @seamHome@
- type: seam switch-project (helloworld-lab3 should be entered as the project name)
- Create a helloworld Stateful Session Bean Conversation
- type: seam new-conversation (This will take you through a list
of text input screens)
- Enter Seam Component Name: hello
- Enter the Local Interface Name: [enter]
- Enter the Bean Class Name: [enter]
- Enter the Action Method Name: [enter]
- Enter the Page Name: [enter]
- Deploy helloworld to JBoss Application Server
- type: seam explode
- Goto URL: http://localhost:8080/helloworld-lab3/hello.seam
- Click: begin (Begins a new stateful conversation)
- Click: increment (Integer value is stored
in memory for the duration of the conversation)
- Cick: end (Ends the stateful conversation
and removes the SFSB from memory)
- EXTRA CREDIT: Add an action method to the Stateful Session Bean
- CHEAT: cd @seamHome@
- type: seam labs-cheat (Enter '3' for the lab cheat you want to apply)
- NO CHEAT: Edit HelloBean.java and Hello.java
- Create a new method called public void saySomething();
- Create a new method called public String getGreeting();
- Edit hello.xhtml
- Add a new command button to the form that calls saySomething()
- Add a new dialog property output for #{hello.greeting}
- type: seam explode restart
- Goto URL: http://localhost:8080/helloworld-lab3/hello.seam
- Click the Say Something button
- type: seam unexplode (Will undeploy the exploded EAR file)
Key Files
@workspaceHome@@sep@helloworld-lab3@sep@view@sep@hello.xhtml
@workspaceHome@@sep@helloworld-lab3@sep@src@sep@com@sep@mydomain@sep@helloworld@sep@Hello.java
@workspaceHome@@sep@helloworld-lab3@sep@src@sep@com@sep@mydomain@sep@helloworld@sep@HelloBean.java
Home | Next