The Java EE 6 Tutorial, Volume I

Modifying the Java EE Application

The Enterprise Server supports iterative development. Whenever you make a change to a Java EE application, you must redeploy the application.

Modifying a Class File

    To modify a class file in an enterprise bean, you change the source code, recompile it, and redeploy the application. For example, if you want to change the exchange rate in the dollarToYen business method of the ConverterBean class, you would follow these steps.

  1. Edit ConverterBean.java and save the file.

  2. Recompile ConverterBean.java in NetBeans IDE by right-clicking the converter project and selecting Run.

    This recompiles the ConverterBean.java file, replaces the old class file in the build directory, and redeploys the application to Enterprise Server.

  3. Recompile ConverterBean.java using Ant.

    1. In a terminal window, go to the tut-install/examples/ejb/converter/ subdirectory.

    2. Type the following command:


      ant all
      

      This command repackages, deploys, and runs the application.

To modify ConvererServlet the procedure is the same as that described in the preceding steps.