Differences between revisions 4 and 5
Revision 4 as of 2009-07-08 16:35:58
Size: 15217
Comment:
Revision 5 as of 2009-09-20 23:01:09
Size: 15225
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
You are now ready to begin. Download the Mojarra samples. They are contained in the Mojarra binary release. Unzip the download to access the samples. Currently, Mojarra contains 6 samples: Cardemo, Components, !GuessNumber, Mojarra_Ext, Renderkits, and Webtier-Sample. This guide describes how to make the simple modifications that are needed to get the [#CarDemo Cardemo], [#GuessNumber GuessNumber], [#Mojarra_Ext Mojarra_Ext], and [#Webtier-Sample Webtier-Sample] samples running in the portlet bridge and exposed as portlets.

   1. [[Anchor(CarDemo)]]!CarDemo
You are now ready to begin. Download the Mojarra samples. They are contained in the Mojarra binary release. Unzip the download to access the samples. Currently, Mojarra contains 6 samples: Cardemo, Components, !GuessNumber, Mojarra_Ext, Renderkits, and Webtier-Sample. This guide describes how to make the simple modifications that are needed to get the [[#CarDemo|Cardemo]], [[#GuessNumber|GuessNumber]], [[#Mojarra_Ext|Mojarra_Ext]], and [[#Webtier-Sample|Webtier-Sample]] samples running in the portlet bridge and exposed as portlets.

   1. <<Anchor(CarDemo)>>!CarDemo
Line 9: Line 9:
                   <link rel="stylesheet" type="text/css"[[BR]]                    <link rel="stylesheet" type="text/css"<<BR>>
Line 12: Line 12:
                 <link rel="stylesheet" type="text/css"[[BR]]                  <link rel="stylesheet" type="text/css"<<BR>>
Line 17: Line 17:
              <portlet>[[BR]]
                <description lang="EN">Mojarra Car Demo Portlet</description>[[BR]]
                <portlet-name>!CarDemo</portlet-name>[[BR]]
                <display-name lang="EN">Mojarra Car Demo</display-name>[[BR]]
                <portlet-class>javax.portlet.faces.!GenericFacesPortlet</portlet-class>[[BR]]

                <init-param>[[BR]]

                  <name>javax.portlet.faces.defaultViewId.view</name>[[BR]]
                  <value>/chooseLocale.jsp</value>[[BR]]
                </init-param>[[BR]]


                <supports>[[BR]]
                  <mime-type>text/html</mime-type>[[BR]]
                  <portlet-mode>view</portlet-mode>[[BR]]
                </supports>[[BR]]
                <supported-locale>en</supported-locale>[[BR]]

                <portlet-info>[[BR]]
                  <title>Mojarra Car Demo</title>[[BR]]
                  <short-title>Car Demo</short-title>[[BR]]
                </portlet-info>[[BR]]
              </portlet>[[BR]]

          * If you downloaded your own copy of Faces 1.2, copy the libraries and other dependent libraries into the WEB-INF/lib directory:
            e.g.
              jsf-api.jar[[BR]]
              jsf-impl.jar[[BR]]
              jstl-1.2.jar[[BR]]
              sun-commons-beanutils.jar[[BR]]
              sun-commons-collections.jar[[BR]]
              sun-commons-digester.jar[[BR]]
              sun-commons-logging.jar[[BR]]
          * Copy the Bridge libraries into the WEB-INF/lib directory:
            e.g.
              portlet-bridge-api-1.0.0-SNAPSHOT.jar[[BR]]
              portlet-bridge-impl-1.0.0-SNAPSHOT.jar[[BR]]
              <portlet><<BR>>
                <description lang="EN">Mojarra Car Demo Portlet</description><<BR>>
                <portlet-name>!CarDemo</portlet-name><<BR>>
                <display-name lang="EN">Mojarra Car Demo</display-name><<BR>>
                <portlet-class>javax.portlet.faces.!GenericFacesPortlet</portlet-class><<BR>>

                <init-param><<BR>>

                  <name>javax.portlet.faces.defaultViewId.view</name><<BR>>
                  <value>/chooseLocale.jsp</value><<BR>>
                </init-param><<BR>>


                <supports><<BR>>
                  <mime-type>text/html</mime-type><<BR>>
                  <portlet-mode>view</portlet-mode><<BR>>
                </supports><<BR>>
                <supported-locale>en</supported-locale><<BR>>

                <portlet-info><<BR>>
                  <title>Mojarra Car Demo</title><<BR>>
                  <short-title>Car Demo</short-title><<BR>>
                </portlet-info><<BR>>
              </portlet><<BR>>

          * If you downloaded your own copy of Faces 1.2, copy the libraries and other dependent libraries into the WEB-INF/lib directory:
            e.g.
              jsf-api.jar<<BR>>
              jsf-impl.jar<<BR>>
              jstl-1.2.jar<<BR>>
              sun-commons-beanutils.jar<<BR>>
              sun-commons-collections.jar<<BR>>
              sun-commons-digester.jar<<BR>>
              sun-commons-logging.jar<<BR>>
          * Copy the Bridge libraries into the WEB-INF/lib directory:
            e.g.
              portlet-bridge-api-1.0.0-SNAPSHOT.jar<<BR>>
              portlet-bridge-impl-1.0.0-SNAPSHOT.jar<<BR>>
Line 55: Line 55:
            <!-- Add portlet binding -->[[BR]]
                <servlet>[[BR]]

                   <servlet-name>!CarDemo</servlet-name>[[BR]]
                   <servlet-class>org.apache.pluto.container.driver.!PortletServlet</servlet-class>[[BR]]
                   <init-param>[[BR]]
                         <param-name>portlet-name</param-name>[[BR]]

                    <param-value>!CarDemo</param-value>[[BR]]
                   </init-param>[[BR]]

                   <load-on-startup>1</load-on-startup>[[BR]]
                </servlet>[[BR]]

            <!-- Add portlet binding -->[[BR]]
                <servlet-mapping>[[BR]]
                  <servlet-name>!CarDemo</servlet-name>[[BR]]
                  <url-pattern>/!PlutoInvoker/!CarDemo</url-pattern>[[BR]]
                </servlet-mapping>[[BR]]
   2. [[Anchor(GuessNumber)]]!GuessNumber
            <!-- Add portlet binding --><<BR>>
                <servlet><<BR>>

                   <servlet-name>!CarDemo</servlet-name><<BR>>
                   <servlet-class>org.apache.pluto.container.driver.!PortletServlet</servlet-class><<BR>>
                   <init-param><<BR>>
                         <param-name>portlet-name</param-name><<BR>>

                    <param-value>!CarDemo</param-value><<BR>>
                   </init-param><<BR>>

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

            <!-- Add portlet binding --><<BR>>
                <servlet-mapping><<BR>>
                  <servlet-name>!CarDemo</servlet-name><<BR>>
                  <url-pattern>/!PlutoInvoker/!CarDemo</url-pattern><<BR>>
                </servlet-mapping><<BR>>
   2. <<Anchor(GuessNumber)>>!GuessNumber
Line 73: Line 73:
              <portlet>[[BR]]
                <description lang="EN">Mojarra Guess Number Portlet</description>[[BR]]
                <portlet-name>!GuessNumber</portlet-name>[[BR]]
                <display-name lang="EN">Mojarra Guess Number</display-name>[[BR]]
                <portlet-class>javax.portlet.faces.!GenericFacesPortlet</portlet-class>[[BR]]

                <init-param>[[BR]]

                  <name>javax.portlet.faces.defaultViewId.view</name>[[BR]]
                  <value>/greeting.jsp</value>[[BR]]
                </init-param>[[BR]]

                <supports>[[BR]]

                  <mime-type>application/xhtml+xml</mime-type>[[BR]]
                  <portlet-mode>view</portlet-mode>[[BR]]
                </supports>[[BR]]

                <supported-locale>en</supported-locale>[[BR]]


                <portlet-info>[[BR]]
                  <title>Mojarra Guess Number</title>[[BR]]
                  <short-title>Guess Number</short-title>[[BR]]
                </portlet-info>[[BR]]
              </portlet>[[BR]]

          * If you downloaded your own copy of Faces 1.2, copy the libraries and other dependent libraries into the WEB-INF/lib directory:
            e.g.
              jsf-api.jar[[BR]]
              jsf-impl.jar[[BR]]
              jstl-1.2.jar[[BR]]
              sun-commons-beanutils.jar[[BR]]
              sun-commons-collections.jar[[BR]]

              sun-commons-digester.jar[[BR]]
              sun-commons-logging.jar[[BR]]
          * Copy the Bridge libraries into the WEB-INF/lib directory:
            e.g.
              portlet-bridge-api-1.0.0-SNAPSHOT.jar[[BR]]
              portlet-bridge-impl-1.0.0-SNAPSHOT.jar[[BR]]
              <portlet><<BR>>
                <description lang="EN">Mojarra Guess Number Portlet</description><<BR>>
                <portlet-name>!GuessNumber</portlet-name><<BR>>
                <display-name lang="EN">Mojarra Guess Number</display-name><<BR>>
                <portlet-class>javax.portlet.faces.!GenericFacesPortlet</portlet-class><<BR>>

                <init-param><<BR>>

                  <name>javax.portlet.faces.defaultViewId.view</name><<BR>>
                  <value>/greeting.jsp</value><<BR>>
                </init-param><<BR>>

                <supports><<BR>>

                  <mime-type>application/xhtml+xml</mime-type><<BR>>
                  <portlet-mode>view</portlet-mode><<BR>>
                </supports><<BR>>

                <supported-locale>en</supported-locale><<BR>>


                <portlet-info><<BR>>
                  <title>Mojarra Guess Number</title><<BR>>
                  <short-title>Guess Number</short-title><<BR>>
                </portlet-info><<BR>>
              </portlet><<BR>>

          * If you downloaded your own copy of Faces 1.2, copy the libraries and other dependent libraries into the WEB-INF/lib directory:
            e.g.
              jsf-api.jar<<BR>>
              jsf-impl.jar<<BR>>
              jstl-1.2.jar<<BR>>
              sun-commons-beanutils.jar<<BR>>
              sun-commons-collections.jar<<BR>>

              sun-commons-digester.jar<<BR>>
              sun-commons-logging.jar<<BR>>
          * Copy the Bridge libraries into the WEB-INF/lib directory:
            e.g.
              portlet-bridge-api-1.0.0-SNAPSHOT.jar<<BR>>
              portlet-bridge-impl-1.0.0-SNAPSHOT.jar<<BR>>
Line 112: Line 112:
            <!-- Add portlet binding -->[[BR]]
                <servlet>[[BR]]

                   <servlet-name>!GuessNumber</servlet-name>[[BR]]
                   <servlet-class>org.apache.pluto.container.driver.!PortletServlet</servlet-class>[[BR]]
                   <init-param>[[BR]]
                         <param-name>portlet-name</param-name>[[BR]]

                    <param-value>!GuessNumber</param-value>[[BR]]
                   </init-param>[[BR]]

                   <load-on-startup>1</load-on-startup>[[BR]]
                </servlet>[[BR]]


            <!-- Add portlet binding -->[[BR]]
                <servlet-mapping>[[BR]]
                   <servlet-name>!GuessNumber</servlet-name>[[BR]]
                   <url-pattern>/!PlutoInvoker/!GuessNumber</url-pattern>[[BR]]
                </servlet-mapping>[[BR]]
   3. [[Anchor(Mojarra_Ext)]]Mojarra_Ext
            <!-- Add portlet binding --><<BR>>
                <servlet><<BR>>

                   <servlet-name>!GuessNumber</servlet-name><<BR>>
                   <servlet-class>org.apache.pluto.container.driver.!PortletServlet</servlet-class><<BR>>
                   <init-param><<BR>>
                         <param-name>portlet-name</param-name><<BR>>

                    <param-value>!GuessNumber</param-value><<BR>>
                   </init-param><<BR>>

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


            <!-- Add portlet binding --><<BR>>
                <servlet-mapping><<BR>>
                   <servlet-name>!GuessNumber</servlet-name><<BR>>
                   <url-pattern>/!PlutoInvoker/!GuessNumber</url-pattern><<BR>>
                </servlet-mapping><<BR>>
   3. <<Anchor(Mojarra_Ext)>>Mojarra_Ext
Line 131: Line 131:
              <portlet>[[BR]]
                <description lang="EN">Mojarra EXT Sample</description>[[BR]]
                <portlet-name>EXTSample</portlet-name>[[BR]]
                <display-name lang="EN">Mojarra EXT Sample</display-name>[[BR]]
                <portlet-class>javax.portlet.faces.!GenericFacesPortlet</portlet-class>[[BR]]

                <init-param>[[BR]]

                  <name>javax.portlet.faces.defaultViewId.view</name>[[BR]]
                  <value>/welcome.jsp</value>[[BR]]
                </init-param>[[BR]]


                <supports>[[BR]]
                  <mime-type>text/html</mime-type>[[BR]]
                  <portlet-mode>view</portlet-mode>[[BR]]
                </supports>[[BR]]

                <supported-locale>en</supported-locale>[[BR]]

                <portlet-info>[[BR]]
                  <title>Mojarra EXT Sample</title>[[BR]]
                  <short-title>EXT Sample</short-title>[[BR]]
                </portlet-info>[[BR]]
              </portlet>[[BR]]

          * If you downloaded your own copy of Faces 1.2, copy the libraries and other dependent libraries into the WEB-INF/lib directory:
            e.g.
              jsf-api.jar[[BR]]
              jsf-impl.jar[[BR]]
              jstl-1.2.jar[[BR]]
              sun-commons-beanutils.jar[[BR]]
              sun-commons-collections.jar[[BR]]
              sun-commons-digester.jar[[BR]]
              sun-commons-logging.jar[[BR]]
          * Copy the Bridge libraries into the WEB-INF/lib directory:
            e.g.
              portlet-bridge-api-1.0.0-SNAPSHOT.jar[[BR]]
              portlet-bridge-impl-1.0.0-SNAPSHOT.jar[[BR]]
              <portlet><<BR>>
                <description lang="EN">Mojarra EXT Sample</description><<BR>>
                <portlet-name>EXTSample</portlet-name><<BR>>
                <display-name lang="EN">Mojarra EXT Sample</display-name><<BR>>
                <portlet-class>javax.portlet.faces.!GenericFacesPortlet</portlet-class><<BR>>

                <init-param><<BR>>

                  <name>javax.portlet.faces.defaultViewId.view</name><<BR>>
                  <value>/welcome.jsp</value><<BR>>
                </init-param><<BR>>


                <supports><<BR>>
                  <mime-type>text/html</mime-type><<BR>>
                  <portlet-mode>view</portlet-mode><<BR>>
                </supports><<BR>>

                <supported-locale>en</supported-locale><<BR>>

                <portlet-info><<BR>>
                  <title>Mojarra EXT Sample</title><<BR>>
                  <short-title>EXT Sample</short-title><<BR>>
                </portlet-info><<BR>>
              </portlet><<BR>>

          * If you downloaded your own copy of Faces 1.2, copy the libraries and other dependent libraries into the WEB-INF/lib directory:
            e.g.
              jsf-api.jar<<BR>>
              jsf-impl.jar<<BR>>
              jstl-1.2.jar<<BR>>
              sun-commons-beanutils.jar<<BR>>
              sun-commons-collections.jar<<BR>>
              sun-commons-digester.jar<<BR>>
              sun-commons-logging.jar<<BR>>
          * Copy the Bridge libraries into the WEB-INF/lib directory:
            e.g.
              portlet-bridge-api-1.0.0-SNAPSHOT.jar<<BR>>
              portlet-bridge-impl-1.0.0-SNAPSHOT.jar<<BR>>
Line 170: Line 170:
            <!-- Add portlet binding -->[[BR]]
                <servlet>[[BR]]

                   <servlet-name>EXTSample</servlet-name>[[BR]]
                   <servlet-class>org.apache.pluto.container.driver.!PortletServlet</servlet-class>[[BR]]
                   <init-param>[[BR]]
                         <param-name>portlet-name</param-name>[[BR]]

                    <param-value>EXTSample</param-value>[[BR]]
                   </init-param>[[BR]]

                   <load-on-startup>1</load-on-startup>[[BR]]
                </servlet>[[BR]]


            <!-- Add portlet binding -->[[BR]]
                <servlet-mapping>[[BR]]
                   <servlet-name>!EXTSample</servlet-name>[[BR]]
                   <url-pattern>/!PlutoInvoker/!EXTSample</url-pattern>[[BR]]
                </servlet-mapping>[[BR]]
   4. [[Anchor(Webtier-Sample)]]Webtier-Sample
            <!-- Add portlet binding --><<BR>>
                <servlet><<BR>>

                   <servlet-name>EXTSample</servlet-name><<BR>>
                   <servlet-class>org.apache.pluto.container.driver.!PortletServlet</servlet-class><<BR>>
                   <init-param><<BR>>
                         <param-name>portlet-name</param-name><<BR>>

                    <param-value>EXTSample</param-value><<BR>>
                   </init-param><<BR>>

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


            <!-- Add portlet binding --><<BR>>
                <servlet-mapping><<BR>>
                   <servlet-name>!EXTSample</servlet-name><<BR>>
                   <url-pattern>/!PlutoInvoker/!EXTSample</url-pattern><<BR>>
                </servlet-mapping><<BR>>
   4. <<Anchor(Webtier-Sample)>>Webtier-Sample
Line 189: Line 189:
              <portlet>[[BR]]
                <description lang="EN">Mojarra !WebTier Sample</description>[[BR]]
                <portlet-name>!WebTierSample</portlet-name>[[BR]]
                <display-name lang="EN">Mojarra !WebTier Sample</display-name>[[BR]]
                <portlet-class>javax.portlet.faces.!GenericFacesPortlet</portlet-class>[[BR]]

                <init-param>[[BR]]

                  <name>javax.portlet.faces.defaultViewId.view</name>[[BR]]
                  <value>/webtiersample.jsp</value>[[BR]]
                </init-param>[[BR]]


                <supports>[[BR]]
                  <mime-type>text/html</mime-type>[[BR]]
                  <portlet-mode>view</portlet-mode>[[BR]]
                </supports>[[BR]]

                <supported-locale>en</supported-locale>[[BR]]

                <portlet-info>[[BR]]
                  <title>Mojarra !WebTier Sample</title>[[BR]]
                  <short-title>!WebTier Sample</short-title>[[BR]]
                </portlet-info>[[BR]]
              </portlet>[[BR]]

          * If you downloaded your own copy of Faces 1.2, copy the libraries and other dependent libraries into the WEB-INF/lib directory:
            e.g.
              jsf-api.jar[[BR]]
              jsf-impl.jar[[BR]]
              jstl-1.2.jar[[BR]]
              sun-commons-beanutils.jar[[BR]]
              sun-commons-collections.jar[[BR]]
              sun-commons-digester.jar[[BR]]
              sun-commons-logging.jar[[BR]]
          * Copy the Bridge libraries into the WEB-INF/lib directory:
            e.g.
              portlet-bridge-api-1.0.0-SNAPSHOT.jar[[BR]]
              portlet-bridge-impl-1.0.0-SNAPSHOT.jar[[BR]]
              <portlet><<BR>>
                <description lang="EN">Mojarra !WebTier Sample</description><<BR>>
                <portlet-name>!WebTierSample</portlet-name><<BR>>
                <display-name lang="EN">Mojarra !WebTier Sample</display-name><<BR>>
                <portlet-class>javax.portlet.faces.!GenericFacesPortlet</portlet-class><<BR>>

                <init-param><<BR>>

                  <name>javax.portlet.faces.defaultViewId.view</name><<BR>>
                  <value>/webtiersample.jsp</value><<BR>>
                </init-param><<BR>>


                <supports><<BR>>
                  <mime-type>text/html</mime-type><<BR>>
                  <portlet-mode>view</portlet-mode><<BR>>
                </supports><<BR>>

                <supported-locale>en</supported-locale><<BR>>

                <portlet-info><<BR>>
                  <title>Mojarra !WebTier Sample</title><<BR>>
                  <short-title>!WebTier Sample</short-title><<BR>>
                </portlet-info><<BR>>
              </portlet><<BR>>

          * If you downloaded your own copy of Faces 1.2, copy the libraries and other dependent libraries into the WEB-INF/lib directory:
            e.g.
              jsf-api.jar<<BR>>
              jsf-impl.jar<<BR>>
              jstl-1.2.jar<<BR>>
              sun-commons-beanutils.jar<<BR>>
              sun-commons-collections.jar<<BR>>
              sun-commons-digester.jar<<BR>>
              sun-commons-logging.jar<<BR>>
          * Copy the Bridge libraries into the WEB-INF/lib directory:
            e.g.
              portlet-bridge-api-1.0.0-SNAPSHOT.jar<<BR>>
              portlet-bridge-impl-1.0.0-SNAPSHOT.jar<<BR>>
Line 228: Line 228:
            <!-- Add portlet binding -->[[BR]]
                 <servlet>[[BR]]

                   <servlet-name>!WebTierSample</servlet-name>[[BR]]
                   <servlet-class>org.apache.pluto.container.driver.!PortletServlet</servlet-class>[[BR]]
                   <init-param>[[BR]]
                         <param-name>portlet-name</param-name>[[BR]]

                    <param-value>!WebTierSample</param-value>[[BR]]
                   </init-param>[[BR]]

                   <load-on-startup>1</load-on-startup>[[BR]]
                </servlet>[[BR]]
            <!-- Add portlet binding --><<BR>>
                 <servlet><<BR>>

                   <servlet-name>!WebTierSample</servlet-name><<BR>>
                   <servlet-class>org.apache.pluto.container.driver.!PortletServlet</servlet-class><<BR>>
                   <init-param><<BR>>
                         <param-name>portlet-name</param-name><<BR>>

                    <param-value>!WebTierSample</param-value><<BR>>
                   </init-param><<BR>>

                   <load-on-startup>1</load-on-startup><<BR>>
                </servlet><<BR>>
Line 239: Line 239:
            <!-- Add portlet binding -->[[BR]]
                <servlet-mapping>[[BR]]
                   <servlet-name>!WebTierSample</servlet-name>[[BR]]
                   <url-pattern>/!PlutoInvoker/!WebTierSample</url-pattern>[[BR]]
                </servlet-mapping>[[BR]]
            <!-- Add portlet binding --><<BR>>
                <servlet-mapping><<BR>>
                   <servlet-name>!WebTierSample</servlet-name><<BR>>
                   <url-pattern>/!PlutoInvoker/!WebTierSample</url-pattern><<BR>>
                </servlet-mapping><<BR>>

It is quick and easy to get most of the samples that ship in the Mojarra binaries running not only in their regular servlet form but also exposed as portlets. First, this guide assumes you have an installed application server running either a portlet 1.0 or portlet 2.0 portlet container. If you don't, consider using Apache Tomcat and Pluto 1.1 or 2.0 to try these out. Once you have verified that your portal/portlet container is properly configured and running, check to see if your application server installation contains a Faces 1.2 implementation. Java EE 5 application servers should contain Faces 1.2. Tomcat being just a servlet/jsp implementation doesn't. If you need a Faces 1.2 implementation do as described here. Finally, download a JSF Bridge release from the Apache MyFaces Portlet Bridge subproject and unzip. It is recommended you use a version of the bridge that best matches the portlet container version running in your environment.

You are now ready to begin. Download the Mojarra samples. They are contained in the Mojarra binary release. Unzip the download to access the samples. Currently, Mojarra contains 6 samples: Cardemo, Components, GuessNumber, Mojarra_Ext, Renderkits, and Webtier-Sample. This guide describes how to make the simple modifications that are needed to get the Cardemo, GuessNumber, Mojarra_Ext, and Webtier-Sample samples running in the portlet bridge and exposed as portlets.

  1. CarDemo

    • Change to the samples/cardemo/build/jsf-cardemo directory.
    • Modify the .css link references in the following files: storeFront.jsp, finish.jsp, customerInfo.jsp, confirmChoices.jsp, chooseLocale.jsp, and carDetail.jsp.
      • Change the following line from:
        • <link rel="stylesheet" type="text/css"

          • href="${pageContext.request.contextPath}/stylesheet.css">

        To:
        • <link rel="stylesheet" type="text/css"

          • href="<%=response.encodeURL(request.getContextPath() + "stylesheet.css")%>">

        Note: In the portlet model you can't output direct URL paths. Rather all URLs must be encoded by the portlet container to allow those containers running remotely from their consumer (portal) to encode the information properly. The above changes work in both the portlet and servlet environments.
    • Add into the WEB-INF directory a portlet.xml file with the following entry for the car demo portlet:
      • <portlet>

        • <description lang="EN">Mojarra Car Demo Portlet</description>
          <portlet-name>CarDemo</portlet-name>
          <display-name lang="EN">Mojarra Car Demo</display-name>
          <portlet-class>javax.portlet.faces.GenericFacesPortlet</portlet-class>

          <init-param>

          • <name>javax.portlet.faces.defaultViewId.view</name>
            <value>/chooseLocale.jsp</value>

          </init-param>

          <supports>

          • <mime-type>text/html</mime-type>
            <portlet-mode>view</portlet-mode>

          </supports>
          <supported-locale>en</supported-locale>

          <portlet-info>

          • <title>Mojarra Car Demo</title>
            <short-title>Car Demo</short-title>

          </portlet-info>

        </portlet>

    • If you downloaded your own copy of Faces 1.2, copy the libraries and other dependent libraries into the WEB-INF/lib directory:
      • e.g.
        • jsf-api.jar
          jsf-impl.jar
          jstl-1.2.jar
          sun-commons-beanutils.jar
          sun-commons-collections.jar
          sun-commons-digester.jar
          sun-commons-logging.jar

    • Copy the Bridge libraries into the WEB-INF/lib directory:
      • e.g.
        • portlet-bridge-api-1.0.0-SNAPSHOT.jar
          portlet-bridge-impl-1.0.0-SNAPSHOT.jar

    • Repackage the jsf-cardemo directory into a .war file deployable in the portlet container running in your application server. Note: package/deployment is portlet container specific. Consult the documentation of your respective portlet container.
      • If you are running in a Pluto 2.0 environment, you can manually package the demonstration if you add the following to the existing web.xml:

        <!-- Add portlet binding -->

        • <servlet>

          • <servlet-name>CarDemo</servlet-name>
            <servlet-class>org.apache.pluto.container.driver.PortletServlet</servlet-class>
            <init-param>

            • <param-name>portlet-name</param-name>

            • <param-value>CarDemo</param-value>

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

          </servlet>

        <!-- Add portlet binding -->

        • <servlet-mapping>

          • <servlet-name>CarDemo</servlet-name>
            <url-pattern>/!PlutoInvoker/!CarDemo</url-pattern>

          </servlet-mapping>

  2. GuessNumber

    • Change to the samples/guessNumber/build/jsf-guessnumber directory.
    • Add into the WEB-INF directory a portlet.xml file with the following entry for the guess number portlet:
      • <portlet>

        • <description lang="EN">Mojarra Guess Number Portlet</description>
          <portlet-name>GuessNumber</portlet-name>
          <display-name lang="EN">Mojarra Guess Number</display-name>
          <portlet-class>javax.portlet.faces.GenericFacesPortlet</portlet-class>

          <init-param>

          • <name>javax.portlet.faces.defaultViewId.view</name>
            <value>/greeting.jsp</value>

          </init-param>

          <supports>

          • <mime-type>application/xhtml+xml</mime-type>
            <portlet-mode>view</portlet-mode>

          </supports>

          <supported-locale>en</supported-locale>

          <portlet-info>

          • <title>Mojarra Guess Number</title>
            <short-title>Guess Number</short-title>

          </portlet-info>

        </portlet>

    • If you downloaded your own copy of Faces 1.2, copy the libraries and other dependent libraries into the WEB-INF/lib directory:
      • e.g.
        • jsf-api.jar
          jsf-impl.jar
          jstl-1.2.jar
          sun-commons-beanutils.jar
          sun-commons-collections.jar
          sun-commons-digester.jar
          sun-commons-logging.jar

    • Copy the Bridge libraries into the WEB-INF/lib directory:
      • e.g.
        • portlet-bridge-api-1.0.0-SNAPSHOT.jar
          portlet-bridge-impl-1.0.0-SNAPSHOT.jar

    • Repackage the jsf-guessnumber directory into a .war file deployable in the portlet container running in your application server. Note: package/deployment is portlet container specific. Consult the documentation of your respective portlet container.
      • If you are running in a Pluto 2.0 environment, you can manually package the demonstration if you add the following to the existing web.xml:

        <!-- Add portlet binding -->

        • <servlet>

          • <servlet-name>GuessNumber</servlet-name>
            <servlet-class>org.apache.pluto.container.driver.PortletServlet</servlet-class>
            <init-param>

            • <param-name>portlet-name</param-name>

            • <param-value>GuessNumber</param-value>

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

          </servlet>

        <!-- Add portlet binding -->

        • <servlet-mapping>

          • <servlet-name>GuessNumber</servlet-name>
            <url-pattern>/!PlutoInvoker/!GuessNumber</url-pattern>

          </servlet-mapping>

  3. Mojarra_Ext

    • Change to the samples/mojarra_ext/build/mojarra_ext directory.
    • Add into the WEB-INF directory a portlet.xml file with the following entry for the mojarra_ext portlet:
      • <portlet>

        • <description lang="EN">Mojarra EXT Sample</description>
          <portlet-name>EXTSample</portlet-name>
          <display-name lang="EN">Mojarra EXT Sample</display-name>
          <portlet-class>javax.portlet.faces.GenericFacesPortlet</portlet-class>

          <init-param>

          • <name>javax.portlet.faces.defaultViewId.view</name>
            <value>/welcome.jsp</value>

          </init-param>

          <supports>

          • <mime-type>text/html</mime-type>
            <portlet-mode>view</portlet-mode>

          </supports>

          <supported-locale>en</supported-locale>

          <portlet-info>

          • <title>Mojarra EXT Sample</title>
            <short-title>EXT Sample</short-title>

          </portlet-info>

        </portlet>

    • If you downloaded your own copy of Faces 1.2, copy the libraries and other dependent libraries into the WEB-INF/lib directory:
      • e.g.
        • jsf-api.jar
          jsf-impl.jar
          jstl-1.2.jar
          sun-commons-beanutils.jar
          sun-commons-collections.jar
          sun-commons-digester.jar
          sun-commons-logging.jar

    • Copy the Bridge libraries into the WEB-INF/lib directory:
      • e.g.
        • portlet-bridge-api-1.0.0-SNAPSHOT.jar
          portlet-bridge-impl-1.0.0-SNAPSHOT.jar

    • Repackage the mojarra_ext directory into a .war file deployable in the portlet container running in your application server. Note: package/deployment is portlet container specific. Consult the documentation of your respective portlet container.
      • If you are running in a Pluto 2.0 environment, you can manually package the demonstration if you add the following to the existing web.xml:

        <!-- Add portlet binding -->

        • <servlet>

          • <servlet-name>EXTSample</servlet-name>
            <servlet-class>org.apache.pluto.container.driver.PortletServlet</servlet-class>
            <init-param>

            • <param-name>portlet-name</param-name>

            • <param-value>EXTSample</param-value>

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

          </servlet>

        <!-- Add portlet binding -->

        • <servlet-mapping>

          • <servlet-name>!EXTSample</servlet-name>
            <url-pattern>/!PlutoInvoker/!EXTSample</url-pattern>

          </servlet-mapping>

  4. Webtier-Sample

    • Change to the samples/webtier-sample/build/webtier-sample directory.
    • Add into the WEB-INF directory a portlet.xml file with the following entry for the webtier sample portlet:
      • <portlet>

        • <description lang="EN">Mojarra WebTier Sample</description>
          <portlet-name>WebTierSample</portlet-name>
          <display-name lang="EN">Mojarra WebTier Sample</display-name>
          <portlet-class>javax.portlet.faces.GenericFacesPortlet</portlet-class>

          <init-param>

          • <name>javax.portlet.faces.defaultViewId.view</name>
            <value>/webtiersample.jsp</value>

          </init-param>

          <supports>

          • <mime-type>text/html</mime-type>
            <portlet-mode>view</portlet-mode>

          </supports>

          <supported-locale>en</supported-locale>

          <portlet-info>

          • <title>Mojarra WebTier Sample</title>
            <short-title>WebTier Sample</short-title>

          </portlet-info>

        </portlet>

    • If you downloaded your own copy of Faces 1.2, copy the libraries and other dependent libraries into the WEB-INF/lib directory:
      • e.g.
        • jsf-api.jar
          jsf-impl.jar
          jstl-1.2.jar
          sun-commons-beanutils.jar
          sun-commons-collections.jar
          sun-commons-digester.jar
          sun-commons-logging.jar

    • Copy the Bridge libraries into the WEB-INF/lib directory:
      • e.g.
        • portlet-bridge-api-1.0.0-SNAPSHOT.jar
          portlet-bridge-impl-1.0.0-SNAPSHOT.jar

    • Repackage the webtier-sample directory into a .war file deployable in the portlet container running in your application server. Note: package/deployment is portlet container specific. Consult the documentation of your respective portlet container.
      • If you are running in a Pluto 2.0 environment, you can manually package the demonstration if you add the following to the existing web.xml:

        <!-- Add portlet binding -->

        • <servlet>

          • <servlet-name>WebTierSample</servlet-name>
            <servlet-class>org.apache.pluto.container.driver.PortletServlet</servlet-class>
            <init-param>

            • <param-name>portlet-name</param-name>

            • <param-value>WebTierSample</param-value>

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

        • </servlet>

        <!-- Add portlet binding -->

        • <servlet-mapping>

          • <servlet-name>WebTierSample</servlet-name>
            <url-pattern>/!PlutoInvoker/!WebTierSample</url-pattern>

          </servlet-mapping>

Running_the_Mojarra_Samples (last edited 2009-09-20 23:01:09 by localhost)