I have an application that embeds an image viewer, written in Adobe Flex, within a jsp page running in a J2EE application on Tomcat 5.5. The image viewer is founded and loaded in the output to the screen, but I cannot get the Image Viewer to display the image correctly, even though I succeed when either I run the .swf from the command-line or from an HTML page.
My webapp is called FRSApp. The directory structure is, under FRSApp:
I have tried other paths to the image file, including
images/map.jpg [required by command-line execution of .swf]
pan_zoom_files/images/map.jpg [required by HTML page (myTest.html) that embeds the .swf file]
The error is either a "failed to load image" generated by the Image Viewer code, or a Flex system error message, resembling a null-pointer exception:
TypeError: Error #1009: Cannot access a property or method of a null object reference. at FIG_PanZoom_for_jsp() at _FIG_PanZoom_for_jsp_mx_managers_SystemManager/create() at mx.managers::SystemManager/initializeTopLevelWindow() at mx.managers::SystemManager/docFrameHandler()
Any ideas are greatly appreciated!!
Joined: Apr 08, 2003
Solved the problem. I had made several mistakes. One of them was to pass in the J2EE context path when what was needed was the fully qualified image url: http://localhost/FRSApp/pan_zoom_files/images/earth-map_small.jpg. The second mistake was to assume the flashvar variable could be picked up by initializing Action Script in the the mxml file. No, the flash variable will only be visible within the <mx:Application> </mx:Application> tags.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Passing correct image-file path in jsp to an embedded adobe flex component