Article 2: publish a simple webapp example.
The simplest thing is helloworld. Let's use servlet to output a hello World and release it to the Solaris.
The following example assumes that you have mastered the servlet Development Method in JB, and correctly configured the Kerberos in JB according to the first article in this article.
Step 1: Open JB and create a new Web application. We name it helloworld. On the context settings page, we name the context "test" and click Generate war. We need to generate a war file. The directory is wwwroot. Complete.
Then, create a servlet in this project, named helloservlet, click Next, and finish. Then we change the output in the automatically generated helloservlet. Java to Hello world.
Compile and test run. JB will run the servlet with its own tomcat. We can see that Hello world is displayed normally.
Create a new ear, which can be found on the new-enterprise page. Click "Next" and take the default value of the system. When setting web modules, click "test. War. Add test. War to the ear. This ear file is named helloworld. Ear.
Right-click helloworld. eargrp and select Properties from the pop-up menu. Select the target container name to be published on the property page of deployment. We chose Jiwei. (This is what we set in the first article ).
Step 2: Release the tool to the image search center.
First, start your Solaris server, and then pop up the release window of the Solaris from tools-EJB delopyment. Click deploy. Wait a moment. If it is released normally, OK. Access http: // localhost/Hello/helloservlet in IE and you will see hello World.
If you have changed the servlet, how can I re-release it? It's easy. Let's change the output to Chinese. In helloservlet. Java, change the output string to "Hello, China ."
Right-click helloworld. eargrp, rebuild it, and recompile it. Redeploy it and republish it. Well, refresh it in IE and you will find that the output string has become Chinese.
Everything is that simple. Please contact yancheng@sharetop.com if you have any questions