5 Replies Latest reply on May 10, 2010 11:05 PM by J D Flex

    Embedding Flex in jsp

    J D Flex

      I am confused on how to get Flex to work along with a j2ee application.

       

      I have got a j2ee project @ /PROJECT/WebContent/jsp/main.jsp.

       

      How do I add a Flex application @ /PROJECT/bin-debug/flexModule.html inside a div tag of my existing j2ee application ?

       

      Thanks

        • 1. Re: Embedding Flex in jsp
          Sree_D Level 2

          we dont need to include the whole html generated by flexbuilder we need to use the object tag in any JSP or Html in J2ee application and place the corresponding swf file in webContent folder and refer it prperly in object tag. Below is a sample example placing MyPanels.swf in a JSP. The swf file is placed in somewhere like WebContent/myProj/flexContent/MyPanels.swf. etc

           

           

          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

          id="MyPanels" width="100%" height="100%"

          codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">

          <param name="movie" value="MyPanels.swf" />

          <param name="quality" value="high" />

          <param name="bgcolor" value="#ababab" />

          <param name="allowScriptAccess" value="sameDomain" />

          <param name="src" value="/myProj/flexContent/MyPanels.swf" />

          <embed src="/myProj/flexContent/MyPanels.swf" quality="high" bgcolor="#ababab"

          width="100%" height="100%" name="MyPanels" align="middle"

          play="true"

          loop="false"

          quality="high"

          allowScriptAccess="sameDomain"

          type="application/x-shockwave-flash"

          pluginspage="http://www.adobe.com/go/getflashplayer">

          </embed>

          </object>

           

           

          Try googling about object tag and flex you will find some examples. Hope this helps

          1 person found this helpful
          • 2. Re: Embedding Flex in jsp
            J D Flex Level 1

            Thanks that was helpful.

             

            I am familiar with embedding the Flex code in my page but what I was worried about is if I had to move the files from bin-debug each time or do I point the output folder from bin-debug to \WebContent\jsp or maybe \WebContent\flex.

            • 3. Re: Embedding Flex in jsp
              Sree_D Level 2

              Better way is to have the output folder pointing to WebContent but it also copies all the content in bin-debug folder. It will be easy to maintain the java project if only the required content is present.

              1 person found this helpful
              • 4. Re: Embedding Flex in jsp
                J D Flex Level 1

                Alright, I got the flow. I understood that I need to change the output folder from bin-debug to WebContent\bin-debug.

                 

                I tried this but once I have changed this both my flex application and even my j2ee application fails to run[404] eventhough there are no compilation errors.

                 

                Thanks again for your help.

                • 5. Re: Embedding Flex in jsp
                  J D Flex Level 1

                  Alright fixed the output folder. I now have a J2EE/Spring/Flex application.

                   

                  Thanks for the help.