Passing correct image-file path in flashVar from jsp into embedded Flex application

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 Flex code is a one-line modification of the
application displayed at (
http://www.adobe.com/devnet/flex/samples/fig_panzoom/).
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,
code:
<%@ taglib prefix="mm" uri="FlexTagLib" %>
<mm:mxml
source="../pan_zoom_files/FIG_PanZoom_for_jsp.mxml" >
<mm:flashvar name="myVar"
value="/FRSApp/pan_zoom_files/images/map.jpg"/>
</mm:mxml>
the code within PanZoom.mxml is,
private var _imageURL:String =
Application.application.parameters.myVar;
<ns1:ImageViewer
id="imageViewer"
imageURL="{ _imageURL }"
bitmapScaleFactorMax="5"
bitmapScaleFactorMin=".05"
width="100%" height="100%"
x="0" y="0"/>
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]
I have succeeded in loading image viewer embedded in the jsp
page when the image path is hard-coded in the mxml file, by means
of the following code:
<div id="swf-id" class="swfcontent"><embed
type="application/x-shockwave-flash"
src="../pan_zoom_files/FIG_PanZoom_for_jsp.swf" id="swf-id"
name="swf-id" bgcolor="#ffffff" quality="high" wmode="opaque"
height="480" width="772"></div>
<script type="text/javascript">
// <![CDATA[
var props = new Object();
props.swf = "../pan_zoom_files/FIG_PanZoom_for_jsp.swf";
props.id = "swf-id";
props.w = "772";
props.h = "480";
props.ver = "9";
props.wmode= "opaque";
var swfo = new SWFObject( props );
registerSWFObject( swfo, "swf-id" );
// ]]>
</script>
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!!

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,
designated by <mx:script> tags. No, the flash variable will
only be visible within the <mx:Application>
</mx:Application> tags.

Similar Messages

  • Correct Image File Format For Magazine Printing

    I am using InDesign CS4 and I would like to know if it's ok to use JPG or JPEG images for printing magazines ?  If not, can you please tell me the correct image file format I should use with InDesign for designing and printing a magazine ?  Also what would be the best way to convert the image files from JPEG to that correct image file format ?

    Use what ever format you like, I perfer .tiff with LSW compression or .eps. If you don't know what you are doing just include the original image when you send you project to the printer and link the image in InDesign don't embedded it.  When you furnish the original image the prepress department can set it up correctly.
    I perfer 300 dpi with image is at 100% of the final size, if the image is printing 150 line screen when printed. 200 dpi is ok for 133 line screen.  I would even perfer a 100 dpi image over a .jpg image that has be over compressed.

  • How To Access JSP Image file Path inside JavaBean Class

    In my Webapplication,i have jsp and javabeans files. i need to send one image file path contains in Image folder to JavaBean[MyBean.java].
    From MyBean i am trying to display that image using PdfGen Application[JAR] in a new PDF Document.
    The Web Application Structure is as
    MyWebApp
    Image
    \ mypic.gif
    JSP
    \myjsp.jsp
    WEB-INF
    classes
    \pack.MyBean.java
    My Question :
    Inside the webapplication[JSP] the image file is accessed as a URL.(like http://localhost:7001/mywebapp/Image/mypic.gif). but From JavaBean: How To access this file? becz inside javabean it needs a complete system path..How to solve this problem? plz send me any solutions related to my problem....Thank U.

    Dear Madruguinha!
    Thank you very much for your tips.
    but i find another one method for accessing the image.
    // Inside Servlet or JSP
    String realPath=getServletContext().getRealPath("Image"+"/pic1.gif");
    Now we can send this exact system path variable to any java beans or java class that needs the image path as "drivename:\foldername\filename" like "c:\myflolder\mypic.gif" and not web context path.

  • How can i upload a image file to server by using jsp or servlet.

    Hi,
    I m gurumoorthy. how can i upload a image file to server by using jsp or servlet without using third party API. pls anyone send me atleast outline of the source code.
    Pls send me anyone.
    Regards,
    Gurumoorthy.

    I'm not an applet programmer so I can't give you much advice there.
    If you want to stream the file from the server before it's entirely uploaded, then I don't believe you can treat it like a normal file. If you're just wanting to throw it up there and then listen to it, then you can treat it like a normal file.
    But again, I'm not entirely certain. You might be able to stream the start of the file from the server while you're still uploading the end of it, but it probably depends on what method you're using to do the transfer.

  • Cannot open image files in PS CS3 from Bridge CS3

    Cannot open file in Photoshop CS3 (10.0.1) from Bridge CS3 (2.1.1.9)
    Tried choosing File>Open and double clicking the image thumbnail
    Error dialogue box pops up and reads:
    Windows cannot find\C:\Program Files\Adobe\Photoshop CS\Photoshop.exe
    I wouldnt expect CS\Photoshop.exe to be found because CS3\Photoshop.exe upgrade is installed.
    Will downloading the Adobe Photoshop update for Adobe Photshop CS3 (11/15/2007) or Adobe Bridge CS3 update for Adobe Bridge CS3 (11/15/2007) be my best bet for correcting this problem?

    Thanks to Freeagent for pointing me to the solution.
    For fellow Windows XP user's:
    Control Panel > Folder Options > File Types
    It would have been nice if the Install Wizard of PS would have handled this automatically or had an advisory instruction to manually associate image files in Windows XP.
    I thought all along this was a Photoshop CS3 / Bridge CS3 problem since Bridge was calling for both the image file and Photoshop.
    If Freeagent has anyone's ear at Adobe please pass this on.
    Thanks Again

  • Image/File Path

    hi there,
    have a slight poblem regarding a file path, when running it (preview) in netbeans the following is fine
    String path = "src\\Game\\images\\character\\man.gif";However the distributed version no longer looks from src\\ its already in Game\\
    So the dist version (jar file) can no longer display
    man.gifAny ideas?
    Thanks
    Edited by: stevanicus on May 27, 2010 12:11 AM

    stevanicus wrote:
    ..This is what i've got,
    URL path = Game.class.getResource("images/character/");
    getImg(path + "man.gif");
    getImg(path + "man1.gif");
    Code snippets are next to useless. For example, this snippet fails to explain what getImg(String) does or how it does it(1). But please don't go on to post a bunch of other snippets you feel explains the problem. For better help sooner, post an SSCCE.
    1) My answers to your latest question would be different if the getImg(String) method was treating that String as a string representation of a File or URL, for instance. But either way I would advise you limit the getImg() method to accept either a File or URL as appropriate, rather than a String representing the same.
    The URL path, is correct thoHow do you know that?(2) Where/how was it checked?
    2)
    - Do a..
    prompt> jar -tf the.jar.. & copy/paste the output here.
    - Check the URL returned from getResource(String) via System.out or System.err.

  • How to remove file path location listings from photos and objects in Acrobat Pro 9.0 PDF?

    After converting a windows-based Powerpoint 2007 presentation to an Acrobat Pro 9.0 PDF, the file path location of all photos and objects are shown in a dialogue box when the cursor is moved over the image as seen in this screenshot below. How can I stop this from happening and remove this feature on my pdf documents? 

    I saw that referenced on a forum, but it does not seem to address the issue I am having.
    As per Adobe Acrobat X Standard * What’s new, the equivalent to the "Tools > Protection > Remove Hidden Information" utility found in Acrobat X Standard is the same as the "Document > Examine Document" feature in Acrobat Pro 9.0. Those tools seem to cover meta data, book marks, hidden text, and deleted or cropped content, but not the file path listings that appear on images and objects converted from Powerpoint presentations and other MS Office programs.
    I have reviewed the settings used while creating a pdf, and have also tried the “Advanced > Preflight tool”, but could not find anything to apply to the issue at hand.
    Thus, this issue has not been resolved, but seems like it should be an easy fix that anyone who publishes pdf documents would want to use to publish clean, professional documents without anyone seeing the file path location of every object and image shown in the document on their hard drive.

  • How to locate the correct image file before reading/saving it

    Hi,
    I would like to find out how to copy/save/read image files from certain website in Java, particularly to locate the right one from various relative URL links on the same website. Below is an example to look at:
    On the main web page
    By selecting (http://www.abc.com/Public/Details.aspx?adid=2007103609) on a tiny camera icon that consist of source code (<td class="even"><a target="_blank" href="http://www.abc.com/Public/Details.aspx?adid=2007135110"><img src="/images/camera.gif" width="19" ...></a></td>) directed me to another page with the actual photo.
    The source code of this secondary page where the photo is located are as follows:
    <script language="JavaScript" type="text/javascript"><!--
    </script>
    <style type="text/css">@import url("http://fdimages.def.com.au/cui/netstrip-20050427.css");</style>
    <div id="networkStripTop">
    <a href="http://www.def.com.au/" onclick="linktop(this);" target="_top"><img src="http://fdimages.def.com.au/cui/digital.gif" height="17" width="95" class="logo" alt="DEF Digital" /></a>
    <div class="links">Any suggestion would be much appreciated.
    Many thanks,
    Jack

    Hi All,
    Could someone give me a hand with suggesting on how to locate the correct links (from multiple web pages) of the image file? I still could not proceed further on this issue.
    There is no problem with saving/reading the file once it is accurately identified.
    Please move it to the Java Technology & XML forum if it is not already in it.
    Many thanks,
    Jack

  • Imported web app image file path shows no picture

    I am trying to import a file path into the image (type) field of a web app, but the image does not appear on page. If I go into the web app item, do nothing but click 'update', the image will appear on page.
    I have tried importing using Auto-Detect, Comma delimited (CSV), and Tab delimited with the same result. I have exported the .CSV from Numbers (app), and tried copy/paste into TextEdit for Tab delimited. Text is UTF-8.
    Is there some trick to getting the import of a file path to work? Do I need to escape the "/" in the file path (ie.   /_assets/images/<filename>    to    \/_assets/images/<filename> )?

    As I am still testing this web app, I uploaded an image through dreamweaver, then went to the web app, clicked the 'select image' link next to the Image field, and continued to fill in the other info.
    Once that was done -- so I had one example web app item in the spreadsheet -- I exported the template, filled it in with additional data, and imported in the various ways described. I am only using the one image. http://mainedreamvacation.businesscatalyst.com/specials
    I get this image visible on page, I had to go in and update each web app item. Tedious for testing; impractical otherwise.
    Thanks for your help,
    Tim
    Graphics / Web Specialist
    Adventure Advertising
    29 Commercial Street
    Rockport, Maine 04856
    207-236-8049

  • Where does the file path get reported from?

    When looking at ZAM software information, it'll show the product name and then like:
    c:\program files\something\
    Where does that path information come from?
    The windows registry?
    Or does it actually come from the location of the .exe itself?

    kjhurni,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://support.novell.com and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • Remove file path and title from PDF? URGENT

    I'm creating a PDF from multiple HTML files. The HTML document title appears at the top of the PDF page and the path/filename appears at the bottom of the PDF page. How do I remove those?
    I'm working from someone else's PC. When I generate PDFs from other HTML docs on my PC, the title and file path do not appear, so I figured that there must be a setting that I used once and forgot. The help has not helped, not has searching the knowledgebase. I'm using Acrobat 8 on WinXP Pro.
    Thanks!

    But I'm not using the Create from Web Page option. I'm using Create from Multiple Files. I'm combining 20 files from different folders.

  • Exporting from JSP into PowerPoint or an Image file

    I am having a JSP file, the data from which need to be exported into a PowerPoint presentation. Can you suggest me some code examples of exporting the data from JSP to PowerPoint or rather to an image (.gif or .jpg), this image file can then be inserted into the PowerPoint.
    I tried exporting to Excel and from there Copy+Paste but this leaves a chance of modifying the data, the other option I used was exporting the data into a .pdf file, but we are currently having Acrobat Reader 4.0 in which there is no Graphic selection tool unless I use the full version.
    My first preference is to export the data into PowerPoint or if that does not work then into an image file.
    Would be helpful if you have some code examples to look at or if you can guide to some useful sites that can help me in achieving this.
    Thanks in advance...

    For exporting the data into .ppt files try the following.
    Set the content type for the jsp as "application/ms-powerpoint"
    and whatever HTML u have would be sent to the ppt.

  • Save image file in server machine from client

    hai
    I am working in swing based applications on linux environment.
    I can able to save the image file from java appln to local directories.
    My doubt is
    how to save that image file in another machine in the same network or in the server machine through java application insead of saving in the local machine.
    if anyone can help me to findout the solution?
    advance thanks,
    Samy.

    The file can be read in the weblayer if it is sent as a mutlipart request. So once u have it i the Webserver u can always send it to the app server by posting it in a location which the app server can read using URL api

  • Is Image File path of  Menus element support relative Path?

    hi,all
    absolute path is OK!
    but relative path no support!
    how to support it?
    thanks
    tony

    Hi Tony,
    The image file does support relative path but it requires a little coding.
    Please have a look at this thread:
    https://forums.sdn.sap.com/click.jspa?searchID=3854863&messageID=1041573
    Kind Regards,
    Owen

  • Windows Disk-Image File:  What to Exclude from Time Machine?

    I don't use Parallels very often, but when I do, the famous, predictable annoyance comes up:  The Windows disk-image file under MacOS gets tweaked, and then suddenly Time Machine has this mondo-huge 25GB file to backup.  That of course, clogs up my Time Machine backup drive.
    A common solution appears to be to exclude that file from Time Machine, and then back it up by some other means.  OK, I'm cool with that, if only I knew what that file is called, and where I could find it, so that I can tell Time Machine to exclude it.
    I'm guessing it's somewhere down in System or System Folder?

    Ask on the Parallels forums, as its their software you have questions about
    Http://forums.parallels.com

Maybe you are looking for

  • What is domain and dataelement.....diff b/w domain and data element

    dear all what is domain? what is data element? In one domain how many data elements are possible to used? with out data element how can u create a table? explain briefly.

  • What does the "other" section consist of? What does it do?

    It is taking up way too much space on my iphone. It takes up 2.45 GB! Its driving me insane! PLease tell me what it does and how I can reduce the "other " section to at least 1GB. I've tried deleting history, other apps, phone calls, and etc. It help

  • Running a jar in the background on Linux

    I have a server that's made in Java. However, when I run it I have to keep the console window open which kind of defeats the purpose of running it on a remote server if my computer has to stay on as well. I can run it in the background at least, but

  • IDOC Error handling using workflow for Inbound process.

    I have a custom idoc which I am processing using a custom inbound function module with the help of a custom process code. I have made the config in BD51/bd67/We42/We57and doing the coding in the inbound function module to handle workflow. But i am st

  • Mail activation agent in 11g

    Hi, I used to implement mail activation agent in 10.1.3.4... But I couldn't find a section of it in 11g. Anyone has pointers on this? Thanks. Sri