How do I configure my web application?

To develop using JavaServer Faces Components for BusinessObjects Enterprise, your web application must be properly configured. Configuring your web application involves several steps:

The following procedure assumes that you are creating a web application from the beginning. However, you can also use the directions below to modify an existing web application.

To set up your web application
  1. Create the following directory structure in the web applications directory of your web application server:
  2.    web_application_name

          WEB-INF/

             web.xml

             faces-config.xml

             lib/

             classes/

          crystalreportviewers11/

    Your web application will be stored in the web_application_name directory. This is the root directory for the web application and contains all of the files that the web application needs. Your web application directory (web_application_name) should be located in the main web applications directory for your web application server (for Tomcat, this directory is typically called webapps).

    The WEB-INF directory contains all of the support files required for your web application. The web.xml and faces-config.xml files are created in this folder.

    The WEB-INF\lib directory contains all of the JAR files required by your web application, including any JAR files that contain custom backing beans (see How do I use backing beans?). Alternatively, custom .class files such as backing beans you create can be stored in the WEB-INF\classes directory.

    The crystalreportviewers11 directory contains all of the support files required by the ReportPageViewer component.

  3. Create a web.xml file and save it in the WEB-INF directory. The web.xml file must be constructed as follows:
  4. <?xml version="1.0"?>

    <!DOCTYPE web-app PUBLIC

      "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"

      "http://java.sun.com/dtd/web-app_2_3.dtd">

    <web-app>

        <display-name>web_application_name</display-name>

        <listener>

            <listener-class>com.sun.faces.config.ConfigureListener</listener-class>

        </listener>

        <servlet>

            <servlet-name>Faces Servlet</servlet-name>

            <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

            <load-on-startup> 1 </load-on-startup>

        </servlet>

        <servlet-mapping>

            <servlet-name>Faces Servlet</servlet-name>

            <url-pattern>/faces/*</url-pattern>

        </servlet-mapping>

        <context-param>

            <param-name>javax.faces.application.CONFIG_FILES</param-name>

            <param-value>/WEB-INF/faces-config.xml</param-value>

        </context-param>

        

        <context-param>

            <param-name>crystal_image_uri</param-name>

            <param-value>/web_application_name/crystalreportviewers11</param-value>

        </context-param>

    </web-app>

    The servlet mapping defined in the <servlet-mapping> tag indicates a prefix mapping, where a URL in the form of http://localhost:8080/web_application_name/faces/logon.jsp will activate the faces servlet which then loads logon.jsp.

    Note:    The <context-param> element containing the crystalreportviewers11 folder reference is only necessary if you are using the ReportPageViewer component in your application.

  5. Create a faces-config.xml file and save it in the WEB-INF directory. The faces-config.xml file must be constructed as follows:
  6. <?xml version="1.0"?>

    <!DOCTYPE faces-config PUBLIC

      "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"

      "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">

    <faces-config>

        <navigation-rule>

            ...

        </navigation-rule>

        <managed-bean>

            ...

        </managed-bean>

    </faces-config>

    faces-config.xml is used to define the navigation rules for your application (see How do I define the navigation flow of my application?) and to initialize and configure managed beans (see How do I configure the default values of Java beans?).

  7. Copy the support and library files required for your web application into the WEB-INF\lib directory:
  8. Copy the contents of crystalreportviewers11 (C:\Program Files\Common Files\Business Objects\3.0 on Windows) into your web application's crystalreportviewers11 directory.
  9. Note:    This step is only required if you are using the ReportPageViewer component in your web application.



Business Objects
http://www.businessobjects.com/
Support services
http://www.businessobjects.com/services/support/