Deploying a Project


The webMathematica Server view can deploy your project to the server. This section describes how deployment works.

Deployment Mechanism

When you click on the Deploy button in the Server view it deploys material from your project to the server. It will use the location of the server as you specified in the preferences. If you have not configured the location, an error dialog will be emitted.

The actual copying is done by Apache Ant, an open source build tool. You do not really need to know anything about Ant unless you want to see the exact details of the copy process. You can learn this by looking at the build.xml file that is created in your project.

Note that the deployment works as a local filesystem copy. This means that the server must be on the same machine as the Workbench. For example, this might be a test server that is used for developing your web material.

Source Code

All .m files found in Mathematica source locations are copied into the WEB-INF/Applications folder in the web application. Typically the source locations are the root of your project, but you can modify them, using the Mathematica project resources.

Web Content

Web content is kept in the project in the WebPages folder, and anything that appears in this folder will be copied to the root of your web application. If you want to place resources into folders in the web application, then you have the same folder structure inside WebPages.

In the following example, you could have the following folders inside your Workbench project.

project
    WebPages
        graphics
            triangles.jsp
            centroids.jsp
            ...

If this project were deployed to the web server, it would make the following structure inside the web application.

webMathematica
    graphics
        triangles.jsp
        centroids.jsp
        ...

You would be able to connect to these resources with a URL like http://server/webMathematica/graphics/centroids.jsp.

WebTest

The file HTMLTest/test.html is created to test the project. Whenever you deploy to the server this file is opened in a web browser. Typically, it contains a link to a file in the server, but you could edit it to insert something else. If the file HTMLTest/test.html cannot be found then a web browser is not opened when you deploy the project.