Business Components for Java Applications


Web Application

Last modified

$Author: bastafidli $
$Date: 2006/08/27 07:52:10 $
$Revision: 1.10 $
$RCSfile: testingwebapplication.html,v $

Web application setup

OpenSubsystems is using Jetty servlet container as a default container to run and test web applications. Eclipse allows you to conveniently start and run Jetty from within IDE with the help of Jetty Launcher you have installed if you have followed setup of the development environment. Before you start, build the web application using the All target as described in the build process and building web application documents. Once the build is finished, refresh the OpenSubsystems project in Eclipse so that Eclipse knows about all the generated files.

Go to Run menu and select Run... menu item. In the Run dialog select Jetty Web and click the New button. In the newly open page type name of the web application you are going to test, for example Open Security.

Click on the Browse button next to Project edit box. In the Project Selection dialog select the OpenSubsystems project and close the dialog with OK button. Next click on the Browse button next to webapp root dir edit box. In the Folder Selection dialog browse to the


directory. Select the webui-compiled directory and click OK button.

Setup web application

Classpath setup

Click on the Classpath tab. As described in the building web application documents, the web application built by the build process doesn't contain class files and libraries needed to run the application. Now you need to tell Jetty Launcher, where to look for them.

In the Classpath list under User Entries find folder called OpenSubsystems and select it. Then click the Remove button to remove it from the list. You have just removed the default libraries needed to built all OpenSubsystems projects. Now you will setup only the libraries needed to run only the web application you want to test.

Click on the User Entries item in the Classpath list and click Add JARs... button. In the JAR Selection dialog go to


folder. Select all JAR files and click OK button. Now back in the Run dialog click the Add JARs... button and in JAR Selection dialog go to


folder. In this folder select all JAR files and click OK button.

Setup web application classpath

Running web application

You are ready to run your web application. Click the Apply button first and the the Run button. The following output should appear in the Console view in Eclipse.

launching Jetty webapp: / on address: using dir: [C:\Development\OpenSubsystems\generated\security\build\webui-compiled] 
08:10:26.125 INFO   [main] org.mortbay.log.LogImpl.add( >16> added org.mortbay.log.OutputStreamLogSink@b66cc
08:10:26.063 INFO   [main] org.mortbay.log.LogImpl.reset( >11> reset
08:10:26.125 INFO   [main] org.mortbay.log.LogImpl.add( >11> added org.mortbay.log.OutputStreamLogSink@18e2b22
Jan 4, 2005 8:10:26 AM org.mortbay.http.HttpServer start
INFO: Starting Jetty/5.0.0
08:10:26.313 INFO   [main] org.mortbay.util.FileResource.<clinit>( >08> Checking Resource aliases
08:10:26.782 INFO   [main] org.mortbay.http.HttpContext.start( >06> Started WebApplicationContext[Open Security,Open Security]
08:10:26.829 FAIL!! [main] org.apache.jasper.EmbeddedServletOptions.<init>( >11> The scratchDir you specified: C:\DOCUME~1\miro\LOCALS~1\Temp\Jetty__jsp__osssecurity is unusable.
08:10:27.016 INFO   [main] org.mortbay.http.SocketListener.start( >05> Started SocketListener on
Jan 4, 2005 8:10:27 AM org.mortbay.http.HttpServer start
INFO: Started org.mortbay.jetty.Server@1de3f2d

Your web application is now ready to be tested. Start your browser and browse to http://localhost:8080/. You will see links that will take you to web pages to test individual features of the included subsystems.

Test web aplication

Once you are done testing your web application you can stop it using the new toolbar button :// added by the Jetty Launcher. The small arrow next to it will show you dropdown menu with two options to stop or restart the web application. If Jetty with web application is not running this menu is not available. In that case use the small arrow next to green arrow Run toolbar button to display recently run applications and start the web application for the subsystems you want to test from there. You can also use the Organize Favorites... menu item to permanently add web applications you want to run to this menu.

Restart web aplication

Next: Validating Web User Interface
Previous: Building Web Application