Setting Up the Packaging Configuration
Before you can deploy your application to JBoss, you need to define the structure of your WAR file through a Packaging Configuration, which you then run to create a WAR file.
|Figure 6: Here's how to define the packaging configuration, from inside the project properties.
Here's how to create a Packaging Configuration:
- Right click on your project in the Package Explorer.
- Select Properties—>Packaging Configurations.
- Right click in the right frame and click Add Std. Archive.
- Select Standard-WAR.war and click OK.
- Right click on the configuration and click Edit.
- Rename it to helloworld.war.
- Expand the configuration.
- Right click on the line with Manifest.MF and remove it.
- Make sure your configuration looks like that shown in Figure 6.
Click OK and you should see a file in your project called packaging-build.xml.
|Figure 7: The Target Choice screen allows you to select the instance of JBoss to which you wish to deploy.
Creating and Deploying the WAR File
Create a WAR file by right-clicking on your project and clicking Run Packaging. You will have to right-click on the project and click Refresh before you see the WAR file. The file should be in the top level of you project.
Right click on the WAR file, select Deployment, and then Deploy To. You will see a Target Choice dialog appear, allowing you to select which application server you would like to deploy to, as shown in Figure 7.
|Figure 8: Test out the Hello World Servlet! Do your results match?
I have JBoss 3.2.2 and JBoss 3.2.3 configured on my machine, thus both servers are available. After selecting the target you wish to deploy to, you should see a dialog that confirms that the application was deployed.
Now, pull up your Web browser and try it out. Go to http://localhost:8080/helloworld/Hello, as shown in Figure 8.
In this article, you learned how to install the JBoss-IDE plugin in Eclipse. You also learned how to configure a JBoss server and how to package and deploy a simple application that server. Keep a lookout for a follow-up to this article in which I will show you how to use the XDoclet features of the JBoss-IDE plugin.