Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing correct image-file path in jsp to an embedded adobe flex component

 
Benjamin Weaver
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

myTest.html
jsp/catalog.jsp
pan_zoom_files/images/map.jpg


The JSP code is thus,



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!!
 
Benjamin Weaver
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic