ByteStream unrecognized, JSP to FLEX

I'm working on a project that requires me to extract images and sounds stored in database and serve to browser.
The images and sounds are stored in the BLOB format and i'm able to retrieve the byte arrays respectively.
I'm trying to send these byte arrays to flex(3) through an HTTP service. However i'm not able to recieve the byte arrays and frankly not sure if this is the right way to do this.
Here are more application specific information
xyz.jsp file has a tag that calls a function from a java class that reads the database
i.e <data><%=abc.getData()%></data>
abc.getData() returns a string(generated of the byte[] of the BLOB data items) and in the flex mxml file i use http request as follows
<mx:HTTPService id="req" url="xyz.jsp" method="POST" resultFormat="e4x" result="rec()"></mx:HTTPService>
and the rec() function has the command to read info like
var str:String = req.lastRequest.data
Everything as far as the syntax is concerned is fine, i say this because if i read some other data form the <data> tag i get the output. I'm thinking there is some issue with sending raw binary information like this.
Any kinda help to solve the problem is appreciated
Thanks and warm regards

Hi there,
Thx 4 d reply , yup i hav seen that blog and hav tried implementing it , however the issue i have mentioned is not converting byte array to image its rather gettin the byte array in the first place. I can use dat blog only wen i hav a valid byte array rite? so it wud be helpful if u help me extract the BLOB from database into a byte array in flex. There are some links i get which uses PHP to do dis but unfortunately i gotta use JSP n i am not able to find a rite way to proceed.
Thx in advance and cheers
Bharat

Similar Messages

  • Help need to embed jsp on flex

    hi,
    i m trying to build jsp application on flex, by keeping flex as the base. i want to navigate to jsp application for flex and i m using spring at the server side.
    could any one help me on this. thnks in advance.

    You can do it with code:
    // set Stage properties
    stage.align = StageAlign.TOP_LEFT;
    stage.scaleMode = StageScaleMode.NO_SCALE;
    // align movieclip
    yourMovieClip.x = stage.stageWidth/2;
    yourMovieClip.y = stage.stageHeight/2;
    // or
    yourMovieClip.x = stage.stageWidth/2 - yourMovieClip.width/2;
    yourMovieClip.y = stage.stageHeight/2 - yourMovieClip.height/2;

  • I think this goes here, Oracle, Java, JSP and Flex

    Ok so I apologize if this does not belong here....
    I want to connect Flex to a Oracle 10g data base, and I managed to connect Java to the oracle data base, now the middle ware is the jsp file. I need to parse the connection through a jsp file in such that what gets produced when a SQL statement of say SELECT * FROM BLA; is a html page that displays all XML so i can through that through flex and display it in a data grid. everything is ready to go but the jsp part...
    How do i get java to spit out the select statment, or any statement that is through the jsp file?

    Adrienk wrote:
    I want to connect Flex to a Oracle 10g data base, and I managed to connect Java to the oracle data base, now the middle ware is the jsp file. I need to parse the connection through a jsp file You're using the word "parse" in a way that makes no sense. You seem to mean "use".
    in such that what gets produced when a SQL statement of say SELECT * FROM BLA; is a html page that displays all XMLWell, then it's not really an HTML page. But you can still use JSP for XML, I believe. But keep in mind that JSP is awful, and you may not even need it.
    so i can through that through flex and display it in a data grid. So basically, you want to create a web service, accessible from your Flex client, that exposes data from that table in XML.
    How do i get java to spit out the select statment, or any statement that is through the jsp file?I suppose you could have a servlet that uses JDBC to query the database, and then forwards to the JSP page to render it.
    But you may not even need JSP for something like this. If it's just a SQL query result set, i.e., basically a grid, the XML may be so simple that the servlet could render it all by itself just fine, maybe by just printing XML code directly, or maybe by making a DOM and serializing it to the servlet's HttpServletResponse output stream.
    There are apparently also taglibs for JSP that can do db queries, but the less you touch JSP the better IMHO.
    The details here would depend on your environment. If you're using an object/relational mapping tool, you wouldn't use JDBC directly. Etc.
    Also I'd advise you to consider caching the rendered XML if the table isn't going to change a lot.

  • How i integrate jsp with flex

    Hi,
    I am having the requirement that i want display my page as flash instead of html as we previously displaying With the help of jsp and now i want integrate through flex.
    Can any one having knowledge about flex.hlep me out.
    I also want sample project which include technologies like Struts, jsp, oracle and flex.
    Cheers
    Srinivasan v

    flex can provided the services called lcds and httpservices. we can use these services to interact with the jsp with flex

  • How to combine javascript, flex

    Hi,
    This is Siva Kumar. I am begginer to adobe flex. I have lot
    of doubts regardng flex. Actually I have different requirements for
    that I think I have to combine javascript and jsp with Flex. Is it
    possible to combine/integrate javascript code with flex. If
    possible anybody help me to in this issue.
    Thanks & Regards,
    Siva Kumar

    A call to JavaScript goes to the browser on client. A JSP request goes to the JSP container on the server. Therefore to
    get a value from your JavaScript and insert it into a JSP Object.will require a request to the server and response back. You could use a form to send the "user" value to the server and the JSP could send response to the browser to set the cookie.
    or maybe an alternative methodWhy don't you use a pure JavaScript solution. Your JavaScript function could set the cookie directly. JavaScript can manipulate cookies by using the "cookie" property of the Document object.

  • Error while using mxml taglib in jsp

    Hi,
    I am getting following error while useing the mxml taglib in
    jsp for flex 2.0.1,
    java.lang.NullPointerException
    flex.webtier.server.j2ee.jsp.MxmlTagImpl.doStartTag(MxmlTagImpl.java:112)
    flex.bootstrap.BootstrapTag.doStartTag(BootstrapTag.java:77)
    org.apache.jsp.test_jsp._jspx_meth_mm_005fmxml_005f0(test_jsp.java:79)
    org.apache.jsp.test_jsp._jspService(test_jsp.java:54)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    My jsp as below,
    <%@ taglib uri="FlexTagLib" prefix="mm" %>
    <html><body>
    <mm:mxml source="reports/sampleapp.mxml" />
    </body></html>
    If any one knows how to resolve above error, please help me,
    My email id : [email protected]
    Regards,
    Chandra Reddy

    did u deploy your dbadapter through console to the plan mentioned for deployment?

  • Embed PDF in a Flex Application

    Hi All,
    I am trying to embed a PDF Document in a Flex Container, but
    I think it is impossible.. Some people talks about iframes, but it
    is not a nice workarround at all.
    I have read that in Adobe Air it is possible to do that.
    ¿Why in Adobe Air and not in Adobe Flex?
    Has anyone been in trouble with this and has a solution?
    Thanks in advance,
    toni

    Here is a work around if you can call a JSP page:
    Flex code:
    var jspLink:URLRequest = new
    URLRequest("jsp/downloadpdf.jsp?fileName=Fundraiser_flyer_2008.pdf");
    navigateToURL( jspLink, "_blank" );
    JSP Page code:
    <%@ page errorPage="error.jsp" %>
    <%@ page import="java.io.*" %>
    <%
    //Get the parameters
    String downloadFileName=request.getParameter("fileName");
    String fileName = application.getRealPath("/downloads/" +
    downloadFileName);
    File file = new File(fileName);
    if (!file.exists()) {
    throw new IOException("File does not exist.");
    // Get the size of the file
    long length = file.length();
    // You cannot create an array using a long type.
    // It needs to be an int type.
    // Before converting to an int type, check
    // to ensure that file is not larger than Integer.MAX_VALUE.
    if (length > Integer.MAX_VALUE) {
    throw new IOException("File too big.");
    response.reset();
    response.resetBuffer();
    response.setContentType( "application/pdf" );
    response.setHeader ("Content-Disposition", "filename=" +
    downloadFileName);
    //Prevent the Java error: "getOutputStream() has already
    been called for this response"
    out.clear();
    out = pageContext.pushBody();
    InputStream in = new FileInputStream(file);
    OutputStream output = response.getOutputStream();
    try {
    int curByte=-1;
    while( (curByte=in.read()) !=-1){
    output.write(curByte);
    } catch (IOException ioe) {
    ioe.printStackTrace(System.out);
    } finally{
    output.flush();
    in.close();
    response.flushBuffer();
    %>

  • How to combine with JSP??

    I am a newble to Flex 2
    I am confuse that how can i combine with JSP to send and
    retrive data with mysql ??
    I have seen some examples that juz make a linking with jsp
    which is printed to XML format for data extracting.
    But how to insert and retrive data dynamically?
    Some people say that it can directly programming mxml in .jsp
    by importing mxml tag library....and finally complie on the web
    server. But .... Wazz is the reason i have to buy flex builder.....
    Are there any way i can program with jsp in flex 2 ?
    i am sorry for my poor english
    any help will be highly appreciated

    Eran,
    Can you elaborate on what you're looking for?
    UCM comes with a number of sample custom element forms. These forms are leveraged within a pretty strict context of the site studio contributor. The primary api is javascript based.
    I don't believe you would be restricted on the types of custom element forms you can create if you're implementing into a jsp/x site. I believe the issue is mostly dependent on how you're calling the SS contributor.
    -ryan

  • BSP and Adobe Flex

    Hi,
    My appology if this topic is not suppose to be here. Please let me know where this topic should be.
    I know nothing about SAP and been given a task to look for the connection between BSP(suppose it is a module of SAP) and Adobe Flex.
    I have done some research about the connection. Been to "Engaging User Interfaces with Adobe Flex". On that blog, there were few methods mentioned. I would like to know if there are any examples you can show me? I am particularly interested in Flex JSP and Flex AJAX.
    Thanks in advance.
    Michael

    Hi Friend,
    Hope these links would also helpful to you.
    Link:[http://www.dev-trend.com/main/?tag=sap-bsp]
    Link:[http://www.saphelp.dkhaitan.com/index.php?option=com_content&view=article&id=65:sap-flex-interfacing-using-bsp-and-function-module&catid=39:sap-flex-integration&Itemid=64]
    Link:[http://www.sap-press.de/download/dateien/1226/sappress_developing_sap_applications.pdf]
    With Regards,
    SHARMILA BRINDHA

  • Flex Builder, debugger and web application: how?

    Hello,
    I'm traying to setup a project in eclipse with both a java
    web application (servlets, jsp) and flex applications as a
    frontend. So I installed flex builder as a plugin on an eclipse+web
    standard tools, then created a WST web application project, and
    used the "Add flex nature.." of the flex plugin. I don't want to
    use the flex data services.
    Now, in a standard run (I installed a tomcat 5.5 and
    configured it in eclipse), my mxlm files are being correctly
    compiled into swf, and they are successfully calling my servlets
    (which simulates a backend xml-based interface).
    I'm having problems in debug: if I launch the debug profile
    related to tomcat, the normal version of the sfw will be used (even
    manually switching to the "-debug" version, it says that a running
    flex debugger has not be found on localhost). On the other way, if
    I launch the debug as a "flex application", it seems to work (it
    stops at breakpoints) but my tomcat is not started at all, the swf
    is accessed as a local file and all call to my servlet will fail..
    so it will stop working almost immediately.
    There is a way to setup eclipse to start standard java
    debugging with tomcat *and* the flex debugger?
    Thanks
    Cosma

    I found a workaround of sorts for the problem: don't
    terminate the applications!
    Previously, I would terminate the application using either
    the Terminate button in the Debug view or by closing the tab in the
    browser (Firefox). Now I just let them pile up in the browser and I
    rarely see this problem.
    In other words, I was having lots of trouble when doing
    Launch-Terminate-Launch-Terminate... but now I just
    Launch-Launch-Launch... and clean up once in a while.

  • BSP + Adobe Flex

    Hi,
    My appology if this topic is not suppose to be here. Please let me know where this topic should be.
    I know nothing about SAP and been given a task to look for the connection between BSP(suppose it is a module of SAP) and Adobe Flex.
    I have done some research about the connection. Been to "Engaging User Interfaces with Adobe Flex". On that blog, there were few methods mentioned. I would like to know if there are any examples you can show me? I am particularly interested in Flex JSP and Flex AJAX.
    Thanks in advance.
    Michael

    Hi Friend,
    Hope these links would also helpful to you.
    Link:[http://www.dev-trend.com/main/?tag=sap-bsp]
    Link:[http://www.saphelp.dkhaitan.com/index.php?option=com_content&view=article&id=65:sap-flex-interfacing-using-bsp-and-function-module&catid=39:sap-flex-integration&Itemid=64]
    Link:[http://www.sap-press.de/download/dateien/1226/sappress_developing_sap_applications.pdf]
    With Regards,
    SHARMILA BRINDHA

  • Setting Browser (Internet Explorer) setup as per my application to run on a new system

    Hi,
      I am using flex code to my project thats runs on Internet explorer after installing "Flash player plugin" and my application has POP Ups and it gets blocked by my browsers....We have to change our Internet setting as to allow all popups manually,
    When i am running my application in a newly installed system with new browser,i should not change my browser setting as per i need to my application, it should automatically change its setting according to run my application i.e., installing flash player plugin and enabling popup blocker and so on.,
    Is there any way to do this following in my code part as to change my browser setting according to my application.
    Note : I have developed my application in J2EE with JSP and Flex Code.
    i need to handle this issue on any part of this application,So please help me if any ideas to solve this
    Thanks in Advance
    With regards
    Gopinath.A
    Software Developer,
    First Internet Systems Pvt Ltd.,
    Chennai.

    That's correct, but one of the great things about Flash/Flex is it makes it easy to create popups within the application that, while they don't overlay other windows in the system, aren't blocked by popup blockers.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Adobe vs Sun

    I'd like to discuss about what technology is better today for
    web-development.
    Coldfusion vs JSP.
    Flex vs Applets
    Apollo vs Java Applications
    FDS vs JEE
    I know that this is a difficult question since there're many
    usability branches from both vendors. But I'd like to know your
    opinion.

    I obviously have a bias and I'm curious to hear what others
    have to say. For my part, I think some of the comparisons are not
    correct. For example ColdFusion and FDS are J2EE applications (or
    ColdFusion is a J2EE application server, depending on how you
    install it); CF can process JSPs just fine and FDS can broker
    remote procedure calls between Flex client SWFs and J2EE beans.
    So what are your opinions?

  • Saving XML changes

    I can load XML into Flex easily enough, but what I want to do
    is send any changes made to the XML while Flex was running, like
    updated info, back to the server replacing the old XML file. How
    would I go about doing this? FilerReference.upload(File.xml,
    toServer) style or something else?

    This will require some server-side functionality, like JSP or
    ASP.NET or CF or PHP.
    I have an example that uses JSP, and Flex 2 or Flex 1.5. Send
    me an email if you would like it.
    Tracy

  • 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.

Maybe you are looking for

  • Why can't I use the mesh tool? - brand new illustrator user

    I am trying to learn to use illustrator - I've been watching the online videos - which are very helpful, but there aren't any that I can find for the mesh tool.  I want to add some shading to the body of this acrobat but every time I try to use the m

  • Substring Error

    what am I doing wrong ? My code is below and so is the error, blowing up on Substring <cfquery name="qryGet_MMI_Data_1" datasource="MMI_db"> Select * from tblMMI_Header,tblMMI_Items_1 where tblMMI_Header.service_req_no = tblMMI_Items_1.service_req_no

  • WD for Java and UWL work items (Adobe HCMPF)

    Hi Experts, I am implementing the Adobe forms HCMPF from the HR Administartive Services BP based on  the 'old' WebDynrpo for Java. SAP references in SAPnote 1024326 that when the WD Java is preferred over the WD ABAP one can configure the Application

  • "systemroot\system32\ntdll.dll" error

    I try to reinstall window xp sp2 on my friend's computer today, boot up from the winxp cd, every thing is fine, but after the windows xp loading screen appears i get a blue screen with the this message : Stop : c000021 unknown hard error \ systemroot

  • T431s: unable to update BIOS 1.14 - 1.16.1.04

    Hi, System updater founds new BIOS, version 1.16.1.04, currently I have version 1.14 (9GHET29WW). However, after starting to download packages, Lenovo System updater returns (always) an error: 1 package did not download. I have Windows 8.1 with all t