How use InputStream tt=getServletContext().getResourceAsStream("mf.jasper")

sir i import all rlated class
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.rave.web.ui.component.Body;
import com.sun.rave.web.ui.component.Form;
import com.sun.rave.web.ui.component.Head;
import com.sun.rave.web.ui.component.Html;
import com.sun.rave.web.ui.component.Link;
import com.sun.rave.web.ui.component.Page;
import javax.faces.FacesException;
import com.sun.rave.web.ui.component.Button;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import javax.imageio.*;
import java.awt.image.*;
import java.awt.*;
use this code in button press event
public String button1_action() {
InputStream forms = getServletContext().getResourceAsStream("/mfa.jasper");
return null;
but sir this line give me error
i need send jasperviewer to client by streem
sir how i use streem
please send me code how i send jasperviewer to client through streem
thank

Found the problem. I used DocumentBuilderFactory to create the Source. By default, it is not namespace aware.
DocumentBuilderFactory.setNamespaceAware(true)does the trick.
HTH, Markus

Similar Messages

  • Trouble with pageContext.getServletContext().getResourceAsStream(..)

    Hi community,
    I'm developing a JSP-Taglib that has to load static resources (like javascript or css files) from the webserver it runs on.
    In the Tag I'm writing I use the following code:
    InputStream stream = pageContext.getServletContext().getResourceAsStream("js/myFile.js");So I get a reference to an InputStream called stream, so far so good.
    When I change the resource in the filesystem, I expected to get a Stream with the new content, but this is not the case. I get a Stream that contains the old resource, even it is not longer there.
    Strange enough, if I change the resource again, the new stream delivers the right content.
    This is reproducible, the first time it works, the second not , the third again, the 4th not, the 5th again, .. and so on..
    It makes me headache, what't happening here?
    I use Java5 in eclipse 3.2.1 with Tomcat 5.5.
    Thanks for your help
    Daniel

    no, I don't restart the webcontainer, thats the trick the application does, I check the lastModified value from the file against the old one, and if it differs, I reload the file.
    Even if the ServletContext is created at startup, it should deliver reliable a valid stream of the file.

  • Using InputStream on EJB method

    Hi everyone,
    i was looking for a way to use InputStream or anything else related to the java.io package on my EJB method. This is the first time that i need to do something like that, so i made a research and i figure out that is impossible use any kind of the io package when i using EJB. Is that true?...
    if this is true, could anyone help me how i can save something on my server using EJB?
    Thanks in Advance

    hi,
    i looked in some forums, and talk with some people who use EJB for so long, and all answers took me to the conclusion that is totally not recommended using streams on ejb methods...i haven't looked on ejb specification to really see if its true...
    Besides, i tried in other way..... first i created my EJB method with a byte[] parameter, and a "service" class which convert this array to an InputStream..and record the file on server...i did a client to test and apparently works without errors, i don't receive any exceptions, so i suppose that at least this part is correct, but i having another problem....
    by the way, anyone know how can i save a certificate on a Keystore??...i'm trying that:
    keyStore = manager.getKeystore("DEFAULT");
         keyStore.load(is, password.toCharArray());     attempting that "is" is the InputStream (same of the problem above) and the second parameter is the password....this code belongs to a method on the "service class" that i mentioned before....
    but nothing happens when i run my app. anyone could help me??
    Thanks in Advance

  • How use multithead with socket

    How use multithead with socket
    I need do a client and server program that accept multitherad issue
    Thanks who can help me

    you'd have to do something like this:
    (this is all assuming you want to read Strings from the socket. setSoTimeout works for any read() call to the InputStream associated with the Socket)
    ServerSocket ss = new ServerSocket(myPort);
    Socket s = ss.accept();
    s.setSoTimeout(5*60*1000); // 5 mins * 60 secs * 1000ms
    BufferedReader in = new BufferedReader(new InputStreamReader(s.getInputStream()));
    boolean running = true;
    while(running)
    try
    String readIn = in.readLine();
    // do whatever you want with the data read
    catch(SocketTimeoutException)
    running = false;
    Now. That's what I think needs to be done. I don't have Java on the machine I'm currently on, so I can't test/verify it, but it goes something like that.
    Good luck,
    Radish21

  • How, using Adobe Connect can increase the number of participants in the meeting? I need more than 25 people.

    Hi, I use licensed Adobe Connect. Earlier in the meeting could involve up to 100 people. Now only 25. How, using Adobe Connect can increase the number of participants in the meeting? I need more than 25 people.
    Thanks for your help.

    The purchasing option through adobe.com only allows up to 25 attendees. If you need more than that, you will need to purchase through a reseller. You can find one that is able to sell in your part of the world, here: Adobe Connect Partners. Just reach out to one of the Global Partners.

  • Help I have 'lost' my downloads icon from the dock. Can I retrieve it? If so please describe how, using simple terms

    Help I have 'lost' my downloads icon from the dock on my desktop Mac. Can I retrieve it? If so please describe how, using simple terms. I have tried searching folders, finder and trash

    Your Downloads folder should be in your Home folder. Just drag it to the Dock.
    If you've managed to delete it, try creating a new folder called 'Downloads'. You will probably need to nominate it in Safari or any other browser preferences as your download destination. (Safari Preferences>General, 'Save downloaded items to:' menu)

  • How  use non cumulative key figure and noncumulative key figure screenshot

    how  use non cumulative key figure and noncumulative key figure screenshot

    Hello,
    Please see this docs for Non-Cumulative and Snapshot scenario,
    [How to Handle Inventory Management Scenarios in BW (NW2004)|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f83be790-0201-0010-4fb0-98bd7c01e328]
    [Non-Cumulative Values / Stock Handling|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e0b8dfe6-fe1c-2a10-e8bd-c7acc921f366]
    Thanks
    Chandran

  • Hey i hav an hp pavilion g series n i would like to kno how use the function keys without having to

    hey i hav an hp pavilion g series n i would like to kno how use the function keys without having to click on the fn + function key

    Hi,
    You can change this in your system bios as described in the link below.
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c02035108&cc=us&dlc=en&lc=en&jumpid=reg_R1002_US...
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • Hello , I want to ask some question about ipads \  How powerful is the iPad?  How useful is it for reading books, newspaper or magazines or for surfing the web? Can you identify any shortcomings of the device?   please help me :(

    Hello ,
    I want to ask some question about ipads \
    How powerful is the iPad? 
    How useful is it for reading books, newspaper or magazines or for surfing the web?
    Can you identify any shortcomings of the device?  
    please help me

    it's less powerful than your average computer. THink of it like a netbook but with a better processor.
    It'll do fine for surfing (although if you browse a lot of flash based sites you will need to get a third party browser since safari doesn't accommodate it)
    You may do OK on reading books, papers or magazines, especially if they have apps, but the ipad's screen is backlit, so it doesn't work well outdoors and you may need to fiddle with the brightness so that you don't get eye strain (it's just like doing too much reading from a computer screen)
    I would say the biggest short comings are data transfer. Apple's preferred work flow is that everything is done via iTunes or the internet....well people dont' always have 100% reliable always on internet access so you can find yourself in a situation where you can't get things on/off the iPad.
    By and large, it's a good device for day to day stuff, but is not a computer replacement.

  • How use my apple tv like second  monitor

    how use my apple tv like second  monitor
    some very help me

    About AirPlay Mirroring in OS X Mountain Lion
    tambien en Español

  • How use different email to get replies upon sent email

    how use different email to get replies to, upon sent email, than the email i check mail for/mail server???

    if email i check mail box is [email protected] to send email and get replies to, with email differ eg [email protected]

  • How use jndi to create a organization and add a  user  to it.(ÈçºÎ´´½¨Ò»¸ö×éÖ¯µ¥Î»)

    how use jndi to create a organization and add a user to it¡£THANKS£¡
    ÈçºÎ´´½¨Ò»¸ö×éÖ¯µ¥Î»,²¢½«Ò»¸öÓû§Ìí¼Ó½øËü¡£Ð»Ð»£¡

    Hi,
    The command above about creating a group only works for the root site of the site collection, because the scope of the user group is site collection level, these groups
    can be used in all the sites in this site collection.
    With the existing groups in the root site, we can add users into them and grant specific permissions of a specific sub site to these groups.
    Here is a demo about how to assign permission to a group using Client Object Model(though in C#) for your reference:
    http://www.c-sharpcorner.com/UploadFile/54db21/set-permission-to-group-in-sharepoint-2010-programmatically/
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • How use Active X object in sap 2005A SP14

    How use Active X object in sap 2005A SP14 with usercontrol in vb.net
    or control in vb.net please show example code
    Thanks for advance

    Hi,
    I try to use this sample too (C# version) but it does not work properly.
    I got two different COMExeptions at line 75:
    fTree = SBO_Application.Forms.AddEx( CP );
    Message: Form - already exists.
    and at line 114:
    AcXTree.ClassID = "MSComctlLib.TreeCtrl.2";
    ErrorCode=-2147417851
    Ausnahme von HRESULT: 0x80010105 (RPC_E_SERVERFAULT)
    I don't know the reason - but i am searching...
    Edited by: David Kostenzer on Feb 20, 2008 4:48 PM

  • How using sql trace event  10128 level 1&2

    hi all,i want ask about sql trace event 10128. how using sql trace event 10128 level 1&2??
    when I've enabled sql trace event 10128 level 2,and i execution query then appears error
    ORA-00604: error occurred at recursive SQL level 1
    ORA-00942: table or view does not exist
    where the fault lies??
    i'm using
    ALTER SYSTEM SET timed_statistics=TRUE;
    ALTER SESSION SET EVENT '10128 TRACE NAME CONTEXT FOREVER, LEVEL 2';

    But nothing issue with me on 10g on windows xp:
    SQL> ALTER SYSTEM SET timed_statistics=TRUE;
    System altered.
    SQL> ALTER SESSION SET EVENT '10128 TRACE NAME CONTEXT FOREVER, LEVEL 2';
    ALTER SESSION SET EVENT '10128 TRACE NAME CONTEXT FOREVER, LEVEL 2'
    ERROR at line 1:
    ORA-00927: missing equal sign
    SQL> ALTER SESSION SET EVENTS
      2      '10128 trace name context forever, level 2';
    Session altered.
    SQL>HTH
    Girish Shamra
    Edited by: Girish Sharma on Dec 9, 2009 11:46 AM
    This is not "EVENT" .. it is "EVENTS"

  • How Use ActiveX Control Item!

    Please Let me know how use OCX Control with ActiveX Control Item in forms6i,
    and send me Sample code(*.fmb).
    Especially, I want to know how handle 'Event' of OCX Control in forms 6i.
    When use VBasic, code is descibed in 'Event' of OCX Control, and then how handle 'Event' of OCX Control in forms 6i.
    return to mail - [email protected]

    I think that if you use an activeX container, property and invoke nodes will work for the document/file or whatever you have in it, so I recommed you to use references to the file you want to use, open an activeX reference in the block diagram, and pass this reference to open, write, save and exit. This can be done easyly using the invoke and property nodes you already know... If not, check for errors between them, sometimes one error makes the rest of the code not to work... Hope this helps.
    If you want me to check the program, you can send an example here, but be sure it's LV 5.0, I've nor 5.1 nor 6.0, it can be a way of knowing the problem.

Maybe you are looking for

  • Found a workflow to export an iTunes playlist in MY play order-doesn't work

    Here is the Automator script I found to work around the fact that iTunes will invariably burn a playlist in alpha order, no matter what we do. I found it here: http://www.macosxhints.com/article.php?story=20080424194133862 1. Automator » Ask for Conf

  • Sender File Content Conversion. Pls suggest

    Hi All, I have to do the Sender File content conversion for the below file. First Line is for Sender. Second Line is for Receiver. Third ,Fourth and Fifth lines are Invoice Numbers which can be more also. The issue is coming that there is no Key Fiel

  • Fuzzy hdtv external monitor

    I've had this problem a while but its really getting on my nerves.  I have a 37" hdtv as an external monitor for my window desktop.  Every once in a while I want to use it with my macbook pro - when I initially did this everything worked fine.  Then

  • Document Header Mandatory for FV50

    Hi Experts, I would like to make the document header a required field for FV50 transactions.  They are document type SA.  I set the document type to make this a required field. However, I don't want all SA document types to require this field.  Is it

  • Error in my jsp pages

    Hi, Well, I4ve installed my jsp application in OAS. The application works fine, except for one function that gives me this error: Request URI:/paa/jsp/Atividade.jsp Exception: java.lang.NoSuchMethodError: java.lang.Double: method parseDouble(Ljava/la