How to use a Servlet to do HTTP streaming?

Hello, everyone!
I want to use a servlet to do simple HTTP streaming, just like what Apache is doing now. I just want the basic functions of HTTP streaming. I want the Servlet works like this, reads data from a local media file and sends through HTTP to client player to do streaming.
Where can I find some sample source codes?
Best regards,
George

Can anyone help?
George

Similar Messages

  • How to use resource servlet ?

    Hi all,
    Does any body know know how to use resource servlet to share resources (xsd, wsdl etc) in OSB ? Kindly provid eme witht the steps
    Thank you.

    Hi Eric,
    We can share the resource in the following way, but unfortunately OEPE doesnt accept http urls in schemaLocation arrtibute
    How can I get the WSDL/Policy/MFL/Schema/Proxy via HTTP?
    You can retrieve many of the resource types directly from the OSB server by using HTTP instead
    of needing to use the service bus console. The general pattern for the URL is as follows:
    http://[hostname]:[port]/sbresource?[Resource Type]/[Project Name]/[Resource Name]
    CHAPTER 18 ■ HOW DO I . . . ? 477
    The [Resource Type] section of the URL may be any one of the following values:
    • BIZ
    • MFL
    • POLICY
    • PROXY
    • SCHEMA
    • WSDL
    The URL must be UTF-8 encoded. If the resource is stored in a directory, then the directory
    structure needs to be declared explicitly in the URL also.
    For example, in the Hello World project in Chapter 4 of this book, we defined aWSDL resource
    in the WSDL folder of the project. The name of that WSDL resource is set to HelloWorld. To retrieve
    this WSDL, you would use the following URL:
    http://localhost:7001/sbresource?WSDL/Hello+World/WSDL/HelloWorld

  • How to use a servlet adapter ?

    Hi all,
    I try to use the servlet adapter, but documentation is not very usefull on this point (like on many other point).
    The first step in documentation is : Create a directory in the classpath oracle.panama.adapter.servlet for the .class
    file. The MasterService creation should go smoothly (if you pray I suppose) if you also have the .class file in a similar directory where you
    are running the Service Designer.
    Questions :
    - I dont understand ' create a directory in the classpath oracle.panama.adapter.servlet'.
    What does it mean ?
    - How can I make the same thing on the client which running the Service Designer ?
    All input are welcome.
    rgds,

    Create your Servlet under the directory
    %ORACLE_HOME%\panama\server\classes\oracle\panama\adapter\servlet.
    The servlet should have the package declaration
    package oracle.panama.adapter.servlet;
    Copt the class file to the above mentioned directory.
    Then create a service using this class.
    Give the entire class name for the service
    eg
    package oracle.panama.adapter.servlet.Test
    where test is the servlet class name.
    null

  • How to use a servlet in a Workflow process step.

    Hi
    I need am upgrading existing code from cq 5.4 to CQ 5.5.
    The exsiting code uses a servlet with an injected @MailService reference to send emails. It is currently used as a process step service.
    However, with CQ 5.5 I see that I need to implement the WorkFlowProcess interface, to see this class listed as in the Process step drop down list.
    The issue I have is if I keep the class as a Servlet extension , it does not show up in the drop down list of the process step.
    Is there a way to update the code to list this servlet as a process step?
    Or is there a way to inject the MailService reference into a class which only implements the "WorkflowProcess" interface and is not a servlet ?
    advice appreciated.
    thanks
    Ven

    The implementation of WorkflowProcess is to be deployed as an OSGi service, so you can @Reference the MailService in that class.
    http://dev.day.com/docs/en/cq/current/workflows/wf-extending.html#Defining a Process Step with a Java Class
    scott

  • How to use "start" and "duration" with HLS stream

    Hi all,
    is it possible to use "start" and "stop" with HLS stream like rtmp stream?
    If yes, how?
    thanks in advance.

    Hi,
    This is completely player side fucntionality you are asking for. However, I guess default player that comes on safari (iPad), quicktime has the player timeline with stop and start option. But if not, you can create your custom player using exposed api of AVPlayer. Check-out AVPlayer api's.
    FMS, by nature of protocol will respect the request to get the data(in case of client-play-start)  and will not automatically push the data to the client if not asked for by the client (as in case of client-play-stop).
    Thanks

  • Need basic info how to run my servlet with SSL/http (I am using Tomcat 4.0.

    I have a servlet that gets a user id and password
    and query information from an HTML form
    and then writes back the answer to the query as a new web page. We want to
    make the transaction secure because it is customer confidential information.
    What do I need to do in my servlet to get it to run under SSL?
    (I am using Apache Tomcat 4.0 on WinNT and
    can use either JDK 1.2.2 or 1.3.1....)
    I know this is a very basic question, but what I'm reading does not
    make it clear to me what I have to do to my servlet code to use SSL, or
    whether the server and client do all the work "outside" my
    servlet code so that no changes to the servlet would be required(???).
    Can I use Tomcat 4.0 for SSL? Any help getting my head pointed in the right
    direction will be much appreciated. (You may reply to this forum or
    to my email: [email protected]
    Much thanks!

    When one follows this how-to, one got the following result:
    The same page, say xyz.html, can be accessed in two ways: one is from
    http://localhost:8080/xyz.html, and the other is from https://localhost:8443/xyz.html.
    How can one allow people to be only able to access from https://localhost:8443/xyz.html, to be not able to access from http://localhost:8080/xyz.html? There is one sentence mentioned some where that Servlet 2.4 specification can do this. But Servlet 2.4 specification would not provide any help. Any clue?

  • How to Obtain Applet -servlet communication through https protocol

    We are trying to use https protocol.
    First I will explain Our Architecture. We are using JRun 3.0
    as servlet engine. We are using iplanet as a webserver.
    There are two iplanet webservers.
    There is a firewall between two iPlanet servers. i.e, one webserver
    is outside the firewall. JRun is communicating with inside iplannett
    webserver and inside iplannett webserver is communicating with
    outside iplannet server.
    If we are trying to run the application with
    this firewall, our applet is not loading,
    but the servlets and jsp pages are all working fine.
    Without the firewall, everything is working fine.
    The applet is also working fine.
    But, with the firewall, our applet is not loading.
    We are using JRE 1.3 as java plug-in.
    What is the problem so that the applet is not loading.
    and How to resolve this? can anybody give suggestion in this regard?
    Thanks in advance.

    No, I am not getting any security exception for the applet, but I am getting the following exception when working with HTTPS. The same application works fine with the default HTTP protocol
    java.net.UnknownServiceException: Input from HTTPS not expected until OutputStream is closed
         at sun.plugin.protocol.https.BrowserHttpsURLConnection.getInputStream(Unknown Source)
         at JBSchedulerXNew.initReceiveAppointmentData(JBSchedulerXNew.java:122)
         at JBSchedulerXNew.initReceiveAppointmentData(JBSchedulerXNew.java:92)
         at JBSchedulerXNewDemo.init(JBSchedulerXNewDemo.java:110)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)

  • How to use the servlets and javabeans in the JavaServer Pages?

    I have some trouble on the usage of JavaBeans and Servlets.
    Who can tell me the resource about those?
    Thank you!

    The JOT Servlets framework integrates Java Beans and Servlets. You can download the evaluation package and look at the demonstration applications to get some ideas about how it works.
    JOT Servlets - http://www.jotobjects.com

  • How to use the servlet api

    I can't compile servlet code because it doesn't recognize the http... classes.
    I downloaded the servlet api but don't know what to do with it (unziped it but no installation!)
    please help

    I can't compile servlet code because it doesn't
    recognize the http... classes.
    I downloaded the servlet api but don't know what to do
    with it (unziped it but no installation!)
    please helpI am having the same problem... i am running windows 95 (unfortunately) and have installed the jsdk1.3.
    These are my autoexec.bat entries
    SET PATH=c:\jdk1.3\bin
    SET JAVA_HOME=C:\jdk1.3
    set classpath=c:\jdk1.3\lib;c:\jdk1.3\jre\lib\ext\servlet.jar%classpath%
    I am still not able to compile a servlet program though.
    Any ideas?
    Much appreciated!!!!
    -Charlie

  • How to use Filter/Responsewrapper to trap http response

    My application deals with various request/responses. How do i write a Responsewrapper or responseoutputstream to trap the contents of the response in a file without fiddling with the actual servletoutputstream, which is thrown back to the browser as usual.

    Thanks for the answers,
    I am using something like this in my filter code
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    CacheResponseWrapper wrappedResponse = new CacheResponseWrapper(hres, baos);
    chain.doFilter(hreq, wrappedResponse);
    FileOutputStream fos = new FileOutputStream(file);
    fos.write(baos.toByteArray());
    fos.flush();
    fos.close();
    FileInputStream fis = new FileInputStream(ile);
    String mt = sc.getMimeType(hreq.getRequestURI());
    response.setContentType(mt);
    ServletOutputStream sos = hres.getOutputStream();
    for (int i = fis.read(); i!= -1; i = fis.read()) {
         sos.write((byte)i);
    The CacheResponseWrapper uses a CacheResponseStream which write the necessary bytes to the provided ByteArrayOutputStream instead of the general ServletOutputStream

  • How to use a servlet to display an excel spread sheet onto a browser?

    Hi, I have a problem here, I couldn't display an excel spread sheet onto a browser..Can anybody enlighten me on how to go about it?
    Thanks

    Hi, I tried to refresh the 'application/vnd.ms-excel'
    page by calling it again from another frame...it give me a blank page.
    Does it means that the excel sheet cannot be reopen once it's open?
    thanks

  • How to use vivado hls::mat with AXI-Stream interfaces (not AXI4 video stream) ?

      Hello, everyone. I am trying to design a image processing IP core with vivado hls 2014.4. From xapp1167, I have known that video functions provided by vivado hls should be used with AXI4 video stream and VDMA. However, I want to write/read image data to/from the Ip core through AXI stream interfaces and AXI-DMA for some special reasons.
      To verify the feasibility, a test IP core named detectTest was designed as follows. The function of this IP core is reading a 320x240 8 bit gray image (bit 7-0 of INPUT_STREAM_TDATA) from the axis port "INPUT_STREAM” and then output it with no changes. I fabricated a vivado project of zedboard and then test the IP core with a AXI-DMA. Experimental results show that the IP core works normally. So it seems possible to use hls::mat with axis. 
    #include "hls_video.h"
    #include "hls_math.h"
    typedef ap_axiu<32, 1, 1, 1> AXI_VAL;
    typedef hls::Scalar<HLS_MAT_CN(HLS_8U), HLS_TNAME(HLS_8U)> GRAY_PIXEL;
    typedef hls::Mat<240, 320, HLS_8U> GRAY_IMAGE;
    #define HEIGHT 240
    #define WIDTH 320
    #define COMPRESS_SIZE 2
    template<typename T, int U, int TI, int TD>
    inline T pop_stream(ap_axiu<sizeof(T) * 8, U, TI, TD> const &e) {
    #pragma HLS INLINE off
    assert(sizeof(T) == sizeof(int));
    union {
    int ival;
    T oval;
    } converter;
    converter.ival = e.data;
    T ret = converter.oval;
    volatile ap_uint<sizeof(T)> strb = e.strb;
    volatile ap_uint<sizeof(T)> keep = e.keep;
    volatile ap_uint<U> user = e.user;
    volatile ap_uint<1> last = e.last;
    volatile ap_uint<TI> id = e.id;
    volatile ap_uint<TD> dest = e.dest;
    return ret;
    template<typename T, int U, int TI, int TD>
    inline ap_axiu<sizeof(T) * 8, U, TI, TD> push_stream(T const &v, bool last =
    false) {
    #pragma HLS INLINE off
    ap_axiu<sizeof(T) * 8, U, TI, TD> e;
    assert(sizeof(T) == sizeof(int));
    union {
    int oval;
    T ival;
    } converter;
    converter.ival = v;
    e.data = converter.oval;
    // set it to sizeof(T) ones
    e.strb = -1;
    e.keep = 15; //e.strb;
    e.user = 0;
    e.last = last ? 1 : 0;
    e.id = 0;
    e.dest = 0;
    return e;
    GRAY_IMAGE mframe(HEIGHT, WIDTH);
    void detectTest(AXI_VAL INPUT_STREAM[HEIGHT * WIDTH], AXI_VAL RESULT_STREAM[HEIGHT * WIDTH]) {
    #pragma HLS INTERFACE ap_fifo port=RESULT_STREAM
    #pragma HLS INTERFACE ap_fifo port=INPUT_STREAM
    #pragma HLS RESOURCE variable=RESULT_STREAM core=AXI4Stream metadata="-bus_bundle RESULT_STREAM"
    #pragma HLS RESOURCE variable=INPUT_STREAM core=AXI4Stream metadata="-bus_bundle INPUT_STREAM"
    #pragma HLS RESOURCE variable=return core=AXI4LiteS metadata="-bus_bundle CONTROL_STREAM"
    int i, j;
    for (i = 0; i < HEIGHT * WIDTH; i++) {
    unsigned int instream_value = pop_stream<unsigned int, 1, 1, 1>(INPUT_STREAM[i]);
    hls::Scalar<HLS_MAT_CN(HLS_8U), HLS_TNAME(HLS_8U)> pixel_in;
    *(pixel_in.val) = (unsigned char) instream_value;
    mframe << pixel_in;
    hls::Scalar<HLS_MAT_CN(HLS_8U), HLS_TNAME(HLS_8U)> pixel_out;
    mframe >> pixel_out;
    unsigned int outstream_value = (unsigned int) *(pixel_out.val);
    RESULT_STREAM[i] = push_stream<unsigned int, 1, 1, 1>(
    (unsigned int) outstream_value, i == HEIGHT * WIDTH - 1);
    return;
      Then I tried to modify the function of detectTest as follow. The function of the modified IP core is resizing the input image and then recoverying its original size. However, it did not work fine in the AXI-DMA test. The waveform captured by chipscope show that the ready signal of INPUT_STREAM was cleared after recieving servel pixels. 
    GRAY_IMAGE mframe(HEIGHT, WIDTH);
    GRAY_IMAGE mframe_resize(HEIGHT / COMPRESS_SIZE, WIDTH / COMPRESS_SIZE);
    void detectTest(AXI_VAL INPUT_STREAM[HEIGHT * WIDTH], AXI_VAL RESULT_STREAM[HEIGHT * WIDTH]) {
    #pragma HLS INTERFACE ap_fifo port=RESULT_STREAM
    #pragma HLS INTERFACE ap_fifo port=INPUT_STREAM
    #pragma HLS RESOURCE variable=RESULT_STREAM core=AXI4Stream metadata="-bus_bundle RESULT_STREAM"
    #pragma HLS RESOURCE variable=INPUT_STREAM core=AXI4Stream metadata="-bus_bundle INPUT_STREAM"
    #pragma HLS RESOURCE variable=return core=AXI4LiteS metadata="-bus_bundle CONTROL_STREAM"
    int i, j;
    for (i = 0; i < HEIGHT * WIDTH; i++) {//receiving block
    unsigned int instream_value = pop_stream<unsigned int, 1, 1, 1>(INPUT_STREAM[i]);
    hls::Scalar<HLS_MAT_CN(HLS_8U), HLS_TNAME(HLS_8U)> pixel_in;
    *(pixel_in.val) = (unsigned char) instream_value;
    mframe << pixel_in;
    hls::Resize(mframe, mframe_resize);
    hls::Resize(mframe_resize, mframe);
    for (i = 0; i < HEIGHT * WIDTH; i++) {//transmitting block
    hls::Scalar<HLS_MAT_CN(HLS_8U), HLS_TNAME(HLS_8U)> pixel_out;
    mframe>>pixel_out;
    unsigned char outstream_value=*(pixel_out.val);
    RESULT_STREAM[i] = push_stream<unsigned int, 1, 1, 1>((unsigned int) outstream_value, i == HEIGHT * WIDTH - 1);
    return;
      I also tried to delete or modify the following 2 lines in the modified IP core. But the transmitting problem existed too. It seems that the IP core cannot work normally if the receiving block and the transmitting block in different "for" loops. But if I did not solve this problem, the image processing functions cannot be added into the IP core either. The document of xapp1167 mentioned that " the hls::Mat<> datatype used to model images is internally defined as a stream of pixels". Does that caused the problem? And how can I solve this problem? Thanks a lot !
    hls::Resize(mframe, mframe_resize);
    hls::Resize(mframe_resize, mframe);
     

    Hello
    So the major concept that you need to learn/remember is that hls::Mat<> is basically "only" an hls stream -- hls::stream<> -- It's actually an array of N channels (and you have N=1).
    Next, streams are fifos; in software that's modeled as infinite queues but in HW they have finite size.
    The default value is a depth of 2 (IIRC)
    in your first code you do :
    for all pixels loop {
      .. something to read pixel_in
       mframe takes pixel_in
       pixel_out is read from mframe
       .. wirte out pixel_out
    } // end loop
    If you notice, mframe has never more than one pixel element inside since as soon as you write to it, you unload it. in other terms mframe never contains a full frame of pixel (but a full frame flow through it!).
    In your second coding, mframe has to actually contain all the pixels as you have 2 for loops and you don't start unloading the pixels unless you have the first loop complete.
    Needless to say that your fifo had a depth of 2 so actually you never read more than 3 pixels in.
    That's why you see that the ready signal of the iput stream drops after a few pixels; that's the back pressure being applied by the VHLS block.
    Where to go from there?
    Well first stop doing FPGA tests and chipscope if you did not run cosim first and that it passed.
    you would have done cosim and it had failed - or got stuck - then you would have debugged there, rather than waiting for a bitstream to implement.
    Check UG902 about cosim and self checking testbench. maybe for video you can't have selfchecking so at least you need to have visual checks of generated pictures - you can adapt XAPP1167 for that.
    For your design, you could increased the depth of the stream - the XAPP1167 explains that, but here it's impractical or sometimes impossible to buffer a full size frame.
    If you check carefully the XAPP, the design operates in "dataflow" mode; check UG902 as to what this means.
    In short, dataflow means that the HW functions will operate in parallel, and here the second loop will start executing as soon as data has been generated in the first loop - if you understand, the links between the loops is a stream / fifo, so as soon as a data is generated in the first loop, the second loop could process that; this is possible because the processing happens in sequential order.
    Well I leave you to read more.
    I hope this helps....

  • Can anyone direct me to a good overview of the new features of iOS 6 (I use an iPhone 4S) so I know what I've got and how to use it?  Thanks!

    Can anyone direct me to a good overview of the new features of iOS 6 (I use an iPhone 4S) so I know what I've got and how to use it?  Thanks!

    http://www.apple.com/ios/

  • HT1212 how to use my Iphone with iTunes

    can you please do let me know how to use iTunes with Iphone

    Read here:
    http://support.apple.com/kb/HT1386

  • How to use no wait in adf

    hi jdev experts,
    am using jdev 11.1.1.5.0 - adfbc-oracle db10g.
    here my code.
    SELECT GlLvlAccountsEO.GLAL_BU,
           GlLvlAccountsEO.GLAL_LVL1,
           GlLvlAccountsEO.GLAL_LVL2,
           GlLvlAccountsEO.GLAL_LVL3,
           GlLvlAccountsEO.GLAL_LVL4,
           GlLvlAccountsEO.GLAL_ACCT,
           GlLvlAccountsEO.GLAL_OPT_TYPE,
           GlLvlAccountsEO.GLAL_CRE_BY,
           GlLvlAccountsEO.GLAL_CRE_DATE,
           GlLvlAccountsEO.GLAL_UPD_BY,
           GlLvlAccountsEO.GLAL_UPD_DATE,
           GlLvlAccountsEO.GLAL_DESC1,
           GlLvlAccountsEO.GLAL_DESC2,
           GlLvlAccountsEO.GLAL_STATUS,
           GlLvlAccountsEO.GLAL_SENT_FLAG,
           GlLvlAccountsEO.GLAL_TITLE_ID,
           GlLvlAccountsEO.GLAL_FBT_PCT,
           GlLvlAccountsEO.GLAL_FBT_CAT,
           GlLvlAccountsEO.GLAL_BUD_FLAG,
           GlLvlAccountsEO.GLAL_PLANT,
           GlLvlAccountsEO.GLAL_CL_ID,
           GlLvlAccountsEO.GLAL_PAR_LVL1,
           GlLvlAccountsEO.GLAL_PAR_LVL2,
           GlLvlAccountsEO.GLAL_PAR_LVL3,
           GlLvlAccountsEO.GLAL_PAR_LVL4,
           GlLvlAccountsEO.GLAL_PAR_ACCT
    FROM GL_LVL_ACCOUNTS GlLvlAccountsEO
    where GlLvlAccountsEO.GLAL_BU = :pbu
    and GlLvlAccountsEO.GLAL_STATUS  IN ('E') for update nowaiterror
    some parenthesis is missing.if i remove the for update nowait means it's perfectly working.
    i know how to use sql statement
    eg:
    select * from dept
    where deptno =10
    for update nowait ;here i can able to understud.
    but,
    In adf why its doesnt supports ah?
    please anyone help me.

    hi john,
    nice to see you here ;)
    in this blog. i read out the how to use for update no wait.
    http://radio-weblogs.com/0118231/stories/2004/03/24/whyDoIGetOraclejborowinconsistentexception.html
    ok. my question is :
    am unable to use the for update no wait statement in query as like as they said.?
    I'll not comment about the use of pessimistic locking like this in a web-based app.ok. am not use pessimistic locking.
    (although I have just implied that there could be some issues - ADF is not Forms).
    ADF is not Forms.
    from this what i understood means.
    some issues - ADF technology
    not in forms technology. are you mean like this. is it so?
    http://jdeveloperfaq.blogspot.com/2010/02/faq-12-how-to-disable-query-wrapping.html could help you
    how does helps me.
    this blogs deals something about advanced stuff operator (union,unionall...)
    i cant your undertud the previous post fully.
    sorry for misunderstanding from your post..
    Edited by: ADF 7 on Jan 30, 2012 12:16 AM

Maybe you are looking for

  • Dreamweaver CS5 errors while moving files

    Hi. I tried moving image files from one folder in my Dreamweaver CS5 site to another (from within Dreamweaver) and it threw the following errors about 3 or 4 times for each file. Any ideas what's going on? Dreamweaver While executing onLoad in tempUR

  • Install ELearning suite 2.5 on Windows 8.1

    When I try to install El suite 2.5 on my desktop a message appears which says not enough space or permission on target folder. I have admin right and also run the exe als administrator. Disc space is nog problem al all. Does anybody know how to solve

  • Ftp URL, j2re1.3.1 versus j2re1.4.1

    Hello everybody I have a client application running on a PC, OS win2k, which regularly uses an ftp URL to download data files from a remote FTP server. There are two options for this, either through an Ethernet LAN or through slow modem connection (1

  • Problem with Photomerge group

    Hi, I'm trying the photomerge group. When I have finished,I click on "Finished" and the I am back in the main menu with the original photos. Where is the merged one ??? Thanks

  • Magic mouse gestures mountain lion

    whats happened to magic mouse gestures on mountain lion...i can't even scroll up or down a web page with my magic mouse now....