Opening XML file in the browser window after generating it.

hi,
my application generates an XML document by retrieving data from Oracle DB. To view that XML file i have to manually open it by going to relavant directory. I want to open it through JSP.
Please help me. any sample code would be appreciated.
thank u.
[email protected]

Instead of writing the xml to a file write it to the response. That will send it back to the browser
Or create a new JSP that opens the file and then writes it to the response.
ServletContext sc = getServletContext();
BufferedReader in = new BufferedReader(new FileReader(sc.getRealPath("/") + "/xml.in"));
String input = null;
response.setContentType("text/xml");
while ((input = d.readLine()) != null) { out.print(input); }
     

Similar Messages

  • Problem opening html file in separate browser window

    I have an forms app where a user can download a file from the database and then open that file on the client. After the file is downloaded, I use webutil_host.nonblocking ('cmd /s start' ||filename) and it works fine for .doc, .xls etc. as these open a separate program. Problem occurs when user downloads an html file, the command opens the file in the same browser window as forms is running, thus ending the forms session.
    I've tried web.show_document('file:\\'||filename) but that fails as I assume it is looking for the file on the application server instead of on the client.
    Any ideas on how to workaround this issue?

    Well I searched around on google looking for a java servlet or jsp example and couldn't find one. I know they are out there becasue thats where I got mine about a year ago. I dont work at the same place anymore and couldnt take my code with me. Anyway, you would use this servlet for any document (xls, doc, html, txt, pdf) that is in the blob column in the db. The servlet would send a mime type first in the response and then the blob. The browser would display the blob in the associated helper application on the client (Excel, Word, IE, notpad, Adobe Acrobat Reader, etc..). The user can then save the document to their hard drive if they wish. This is faster becasue the clients hard drive isnt involved in the transfer from db to client. The user can then edit the document and reupload the document. Thats how we did it.
    Maybe somebody else can post a link to a generic blob download servlet? Thanks..

  • Can't open PDF files in the browser. I've tried every fix mentioned and it still doesn't work!!!

    I have Windows XP. Using firefox as my browser. Suddenly, I can't open PDF files in the browser. I've tried all the fixes mentioned. Nothing works!!! Checked the plugin settings, checked Adobe Reader settings.

    I already fixed it. I never exited out of Firefox before deleting the mime file. it works now.

  • When I have the downloads window open and I close the browser window, how can I get the browser to open the homepage the next time I start it while the download window is still open?

    When I have the downloads window open and I close the browser window, the next time I reopen the browser while the downloads are still going, it returns me to the last page I was on. All previous versions of Firefox would return me to my homepage which I would prefer. Please let me know if this is possible.

    When you re-open Firefox and choose Restore Session, by default it picks up your most-recently-open window, and the other windows should then show up in Recently Closed Windows.
    The Firefox add-on Session Manager lets you manage how many closed windows and closed tabs are saved, in case it's not enough.

  • What can I do to rectify the situation in which Firefox will not open pdf files in the browser, even though I have already used all the help suggestions to no avail?

    I have tried everything Mozilla has suggested. Still when I click on a pdf, I get the message that the browser cannot open a pdf. I have gone through the help protocol, and it does not work.
    I have uninstalled Firefox and reinstalled it, and still not able to open pdf files within the browser.
    What else do I do, except go to IE or Chrome and just leave Firefox completely???

    A possible cause is the presence of a PDF plugin from an older Adobe Reader plugin in the plugins folder in the Firefox program folder.
    See [[Troubleshooting plugins]]
    See also:<br />
    http://kb2.adobe.com/cps/405/kb405461.html - The Adobe Acrobat/Reader cannot be used to view PDF files in a browser<br />
    http://kb2.adobe.com/cps/836/cpsid_83688.html - I can’t view a PDF document in my web browser<br />

  • How to open KM file in the same window

    When we open KM file by /irj/go/km/docs/... link it is previewed in a new Internet Explorer window.
    We changed Targed property to Self for iView navigation in LayoutSet render but the image file is still opend in new Window.
    How to workaround this?

    We changed Target Window Type property value of ResourceRenderer of Navigation iView  to Self.
    When an authenticated user  tries to open KM file it is opened in the same window if file URL include /irj/servlet/prt/prtroot....
    If file URL contain /irj/go/km/docs/.. it is opened in new window.
    When an anonymous user  tries to open KM file it is opened in a new (popup) window.
    We need that anonymous user can open km files in the same window.
    How to work around this?
    We use light framework.

  • Trying to open a file in the browser and Adobe reader/acrobat says to quit and try again (1:9) HELP

    trying to open a file in the browser and Adobe reader/acrobat says to quit and try again (1:9)
    Do this over and over and even reinstalled several times to no avail. Mac running the latest Mt. Lion
    HELP

    click file > place formats to import graphic files.
    http://helpx.adobe.com/indesign/kb/supported-file-formats-indesign-cs5.html

  • Opening pdf file in a  browser window.

    I have a requirement to open a pdf file in a new browser window after onClick of a link. It is not the url of the pdf file. Actually the pdf file is generated dynamically by reading a blob column from the database and converting into a byte array and writing it to the outputstream. This is the code
    Currently on click of the link we are opening a jsp file which has the following code. We have put target=_blank in the link.
    String fileName = "DownLoadFile.pdf";
    response.setContentType("application/pdf");
    response.setHeader("Content-Disposition", "inline;filename=\""+ fileName + "\"");
    response.setContentLength(retrieveDocumentValue.getDocumentObj().length);
    try{
    ServletOutputStream out1 = response.getOutputStream();
    out1.write(retrieveDocumentValue.getDocumentObj());
    out.close();
    } catch (IOException e) {
    out.println("IO Exception");
    e.printStackTrace();
    }The problem is that,It is opening two window, one is an blank browser window and other pdf file in the Acrobat reader application? How can we open the file directly in the browser only without opening the Acrobat reader application externally?
    Edited by: thisisananth on Sep 17, 2008 11:13 PM

    We are facing this problem with IE6 browser only. In firefox, it opens fine in a browser window. What configuration should we do in IE6?
    Thanks,
    Ananth.

  • Opening SWF Files in the Application window

    Hello Everyone,
    We have a problem in opening .swf files in our application.
    We had quick time movies(.mov) which we used to open and
    play inside the application window, using QuickTime Framework APIs
    in the code.
    Presently we had converted these quicktime movies(.mov) into
    .swf files and we are unable to open the same using Quick Time
    Framework in MacOSX.
    Can you please suggest me as how should I proceed, i.e which
    framework should I use in the code to open and play .swf files in
    the application window?
    It will be better, if you can send me a small sample code to
    use in my application for MacOSX.
    Awaiting for your kind reply,
    Thanking you,
    With Best regards,
    Anil.

    Hi Vaibhav,
    I need to display the serarch results in the same window.
    I have followed the steps mentioned by you in the thread
    <i> Search Results in the Same Window..as we have in SDN</i>
    Even after making changes to 2 PAR files mentioned in the above thread, on click
    of Search button nothing happens.
    It will be great if you can send me your modified PAR files, to identify where i am
    going wrong. My mail id is [email protected]
    Thanking you,
    Vikas

  • What metadata is saved within the Quicktime file from the Browser window?

    I'm wondering if anybody could provide a list which contains the metadata that's saved in relation to the available columns in the browser window in Final Cut.
    For example, I know if I change a clip's Reel name, that information is saved into the actual Quicktime file so if I bring that file into a new project, FCP's Reel column will automatically display the new Reel name.
    On the flipside, information such as "Angle" doesn't seem to be saved. Curious as to what's saved and what isn't.

    If you rename the clip in the Browser, that does not affect the captured file. But, if you change the reel name, it is. However, any log notes or things you add in the columns after you capture won't be included in the clip if you import that from the raw file. HOWEVER, it will be attached if you drag the clip from one project to the new one.
    Shane

  • Opening new tabs makes the browser window wider

    when opening a new tab in safari
    it makes the browser window bigger (at the bottom)
    but not only at the bottom actually
    after a few close-open's it also starts growing at the top
    and for me it's unacceptable cause there are folders that i need fulltime access to (at the top)
    is there a way (a script) to prevent safari "grow" and make the browser window bigger in a while ?
    i don't really know why is it happening because if you press cmd+t it opens a new tab and the browser window kinda slides bigger at the bottom but then if you press cmd+w it does the opposite and the browser window stays the same size after those actions
    i can't follow but after some time it starts to be bigger not only at the bottom
    it grows til the dock and then starts growing at the top
    is there a way to prevent that ?
    i mean take opera for example. it always stays the same size and new opened tabs take the "inside space" if you know what i mean. the browser window doesn't get bigger. there is space allocated especially for tabs
    i like safari but it is very important for me that it stays the same size all the time
    i have all windows and folders situated exactly where i want them and if something moves and covers other items, it gets uncomfortable
    thank you

    nimionsergei wrote:
    (i have 'secrets' app installed and it makes pop up windows open in the same browser window, so it might be becasue of that)
    Yes, it sounds like this is the cause.
    Some pop-up window code forces the new window to be a certain size. Since it's intended to open in a new window, that normally wouldn't cause problems. But you're forcing the pop-up to open as a new tab in the current window, which causes the current window to be resized to that new page's defined size.

  • Not able to open XML file in the application server..........

    Hi,
    I have downloaded a XML file to the application server.....
    File is created but i am not able to open the file there....
    Plz advice ....how to open it.....
    Regards.

    Use Notepad. Drag and drop in notepad.
    Aman

  • How to open two files in the one window in PSE11?

    In older versions of PSE I was able to open two picture files in the same window by just resizing them smaller so that I could deal with them side by side........I couoldn't do it in PSE=10, and I upgraded to PSE11 and still don't know how to do it.  Can somone assist me?  Thanks..

      In the Organizer select two thumbnails and hit the F12 key to compare them. But I guess you mean in the Editor application. In Expert Mode it‘s possible to work with floating windows rather than fixed tabs but you first need to set your preferences. Go to:
    Edit >> Preferences >> General (Windows)
    Photoshop Elements Editor >> Preferences >> General (Mac)
    Then put a checkmark in the box against “Allow Floating Documents in Expert Mode”
    Click OK
    You can now open your two images and use the layout button at the bottom to choose various configurations or to cascade.
     

  • Can't get Firefox to NOT open PDF files in the browser

    I would like Firefox to always ask whether I want to open or save a PDF document. Instead, it always displays the file in the browser and pops up a toolbar. In Tools/Options/Applications pdf files are not listed. However "PDF Xchange Viewer Document" (my default PDF viewer) is listed and the action is set to "Always ask"; yet it never asks. Why?

    Such actions are usually linked to a specific MIME type and if Firefox doesn't obey and ask what to do then you may have created this action for the wrong MIME type.
    *http://kb.mozillazine.org/File_types_and_download_actions

  • Opening Excel file in User browser window

    Hi,
    My application generates Excel file from the rowset and stores on the server automatically when the user clicks a button, but I want the Excel file to be downloadable by the user either by opening the Excel file in the browser or by prompting the user to save the Excel file on the users PC.
    Any help will be greatly appreciated.
    Regards
    kush

    Hi Runa,
    Thanks for getting back to me. I have been through the already but that doesn't answer my question.
    Here is what i did, it might be rude but easy,
    public String generateExcel_action() {
    WorkbookSettings ws = new WorkbookSettings();
    workbook = jxl.Workbook.createWorkbook(new File("test.xls"));
    WritableSheet s1 = workbook.createSheet("Number Formats", 0);
    writeNumberFormatSheet(s1);
    workbook.setColourRGB(jxl.format.Colour.LIME, 255, 0, 0);
    workbook.write();
    workbook.close();
    }catch (Exception e){
    log("Exception while generating Excel file" + e);
    return null;
    * Writes out a sheet containing the various numerical formats
    * @param s
    public void writeNumberFormatSheet(WritableSheet s) throws WriteException
    try{
    WritableCellFormat wrappedText = new WritableCellFormat
    (jxl.write.WritableWorkbook.ARIAL_10_PT);
    wrappedText.setWrap(true);
    WritableFont wf = new WritableFont(jxl.write.WritableFont.ARIAL, 12);
    wf.setItalic(true);
    WritableCellFormat wcf = new WritableCellFormat(wf);
    CellView cv = new CellView();
    cv.setSize(25 * 256);
    cv.setFormat(wcf);
    s.setColumnView(0, cv);
    s.setColumnView(1, cv);
    s.setColumnView(2, cv);
    s.setColumnView(3, cv);
    WritableCellFormat horizontal = new WritableCellFormat();
    horizontal.setOrientation(jxl.format.Orientation.HORIZONTAL);
    // column headings
    Label l = new Label(0,0,"National Fault Number", horizontal);
    s.addCell(l);
    l = new Label(1,0,"Fault Title", horizontal);
    s.addCell(l);
    l = new Label(2,0,"Company Name", horizontal);
    s.addCell(l);
    l = new Label(3,0,"System", horizontal);
    s.addCell(l);
    int row =1;
    national_faultsRowSet.setCommand("SELECT * from national_faults");
    national_faultsRowSet.execute();
    while(national_faultsRowSet.next()){
    l = new Label(0,row,national_faultsRowSet.getString("national_fault_number"); , wrappedText);
    s.addCell(l);
    l = new Label(1,row,national_faultsRowSet.getString("fault_title"), wrappedText);
    s.addCell(l);
    l = new Label(2,row,national_faultsRowSet.getString("company_details.company_name"), wrappedText);
    s.addCell(l);
    l = new Label(3,row,national_faultsRowSet.getString("system.system");, wrappedText);
    s.addCell(l);
    row++;
    } catch (Exception e){
    log("Exception in writing EXcel " +e);
    test.xls is generated and stored in /install-dir/SunAppServer8/domains/creator/config, but I want the test.xls file either open in browser or prompt the user to save on his PC.
    I tried to get the data from dataTableModel's cache, for some reason it always returns null, any most obvious reason????
    Cheers
    kush

Maybe you are looking for

  • Has anyone else experienced this same problem?

    Whenever I press the menu, forward, back, play and pause buttons my ipod does what the middle button is supposed to do. When I press Menu it won't take me to the menu. When I press play or pause it won't play or pause. When I press forward or back it

  • MASS MAINTENANCE FOR MATERIAL-RELATED EXCISE DUTIES FIELDS - T CODE

    Dear Experts, Is there any separate t code available to  MASS MAINTENANCE FOR MATERIAL-RELATED EXCISE DUTIES FIELDS ? I got this POINT from ECC 6.0 features in Solution browser. Please help me on this. MASS MAINTENANCE FOR MATERIAL-RELATED EXCISE DUT

  • The cube should be use  ggregate?

    I used a sap delivery cube and it had two hundred million record,so run the query is very slowly,what should i do?          I thought use aggregate may be the best method to solve this problem.but i 'm not sure!

  • Clear pixel in Macbook pro 17" 2009

    I have found out that my screen has a clear pixel. Can i get warrenty for this? other wise i wil call the insurence because i got an insurance for my macbook pro. And is for everything.

  • ITunes contents won't list on new computer

    I got a new computer last Christmas, and I downloaded iTunes to it, but whenever I try to plug in my iPod, iTunes does not list the songs I put there, nor my playlists.  It did recognize the songs I downloaded from the store, but will not play them.