Displaying XML Document in new browser window

Hi,
I have a hyperlink on my page. When I click on it, it will open a new IE window and display xml document.
The new window is displaying some of the xml and at the end displaying the following:
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
End element was missing the character '>'. Error processing resource 'http://localhost:28080/benchmark/faces/displayXMLDocu...
However, I cut and paste the xml String where I write it to the HTTPServletResponse to XMLSPY and it displays correctly.
Please let me know.
Rgrds

Here are the steps:
1. I created page1 that has a hyperlink.
2. Hyperlink property are set to display page2 in a new window. (popup).
3. page2.prerender() method, I set the response to the following:
public void prerender() {
javax.faces.context.ExternalContext ec = this.getExternalContext();
HttpServletResponse response = (HttpServletResponse)ec.getResponse();
response.setHeader("Cache-Control","no-cache");
response.setHeader("Cache-Control","no-store");
response.setHeader("Cache-Control","must-revalidate");
response.setHeader("Cache-Control","max-age=0");
response.setHeader("Pragma","no-cache");
response.setHeader("Expires","0");
response.setContentType("text/xml");
response.setBufferSize(5000);
String xmlString = getRequestBean1().getBookingPnrDetailsXML();
try{
xmlString="<?xml version=\"1.0\" encoding=\"UTF-8\"?><root><test1>this is a test</test1><victor>Hello Victor</victor></root>";
PrintWriter out = new PrintWriter(response.getOutputStream());
log(xmlString);
out.print(xmlString);
}catch(IOException io){
System.out.println("" + io.getMessage());
io.printStackTrace();
4.page2.jsp code is the following:
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:ui="http://www.sun.com/web/ui">
<jsp:directive.page contentType="text/xml;charset=UTF-8" pageEncoding="UTF-8"/>
<f:view/>
<ui:page binding="#{displayXMLDocument.page1}" id="page1"/>
<ui:html binding="#{displayXMLDocument.html1}" id="html1"/>
<ui:head binding="#{displayXMLDocument.head1}" id="head1"/>
<ui:link binding="#{displayXMLDocument.link1}" id="link1"/>
<ui:body binding="#{displayXMLDocument.body1}" id="body1"/>
<ui:form binding="#{displayXMLDocument.form1}" id="form1"/>
</jsp:root>
please let me know.
Rgrds.

Similar Messages

  • Open pdf's, documents in new browser window SharePoint 2010

    Hi all,
    when a user clicks on pdf's, documents, html pages etc in a document library I need them to open in a new browser window. I've found lots of articles on how to do it in 2007 but none work in 2010. I know its not an out of the box function but people
    have done it with Java script or adding code to the document library allitems.aspx web part, I just can't replicate those steps in 2010.
    I'm not a developer or anything but can put code in the right place using SharePoint designer 2010.
    Pulling my hair out at the mo,
    please help
    thanks in advance

    Create a Document Library called ScriptLibrary.
    Download the Jquery library here: http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4.min.js
    Create a new file called: OpenPDF.js
    Paste the following Code in the file:
    $("A[href$=.pdf]").click(function() {
          window.open(this.href);
    Upload both files to your newly created ScriptLibrary.
    The ScriptLibrary should have 2 files: jquery-1.4.4.min.js and OpenPDF.js
    Navigate to the List Page that has the PDF's that you need opened in a new window.
    Click Site Actions: Edit Page,
    Insert > Content Editor WebPart
    Click to Edit the HTML Source of the HTML WebPart, then paste in the following to reference the two files you uploaded to your Script Library:
    <script type="text/javascript" src="/ScriptLibrary/jquery-1.4.4.min.js" ></script>
    <script type="text/javascript" src="/ScriptLibrary/OpenPDF.js" ></script>
    *The src needs to point to the files you uploaded
    Save the page then click on a PDF, it should open in a new window.
    You can then export that ContentEditorWebPart to your webpart gallery, and just insert the webpart on any page that needs the same functionality.

  • Uploading documents to show in new browser window

    Please can you let me know when we will have the option to upload files (eg Word, Excel) and display these items in a new browser window? At the moment the only way round this is to load a file and then create a URL link to this file.
    Thanks

    Hi Jan
    Add your document (eg Word) as a File item type. Then view the document by clicking on the display name. Highlight the URL and copy it.
    To create a URL link to this document select Add Item and choose URL. Paste the URL you have just copied from the original document into the URL field - fill in the other primary and secondary attributes - choose to open document in new browser window.
    Go back to your original Word document and hide it from view.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Jan:
    Katie,
    can you tell me how to make such an upload an create a link to it ? That's exactly what I'm trying to do ...
    Thanks,
    Jan<HR></BLOCKQUOTE>
    null

  • Outputting Servlet information to a new browser window

    I have a simple form that has a few input text fields and a button. When the button is clicked, the information is submitted to a servlet that uses the information to generate XML and display it on the browser window.
    My question is that is it possible to output the XML to a new browser window not the one where the information was submitted from?
    Example, I submit some information, a new window pops up displaying the XML. The form window remains as is and outputs a submitted message.
    Any code would be appreciated.
    Thanks
    Rizwan

    well thats realy not a servlet q, but a html/jsp q..
    your form submit should go to the same page as the form resides on..
    in your servlet you process and prepare the response
    in your formpage you should detect when a submit has taken place (request.getParam... some variable added in your response prepare
    if this is the case, use java script to open a new page (also posting your response information)
    brgds Per Fisker

  • Open sso enabled app in new browser window

    I have a java app deployed to OAS and secured with Single Sign on. I would like my app to open a report and display it in a new browser window. When the new window opens I am getting an error stating that user is not authorized to access the report. This is due to the session information (successful login) being stored with the cookie in the original browser window (where the session started and where the user originally logged in). Is there a way to pass that cookie information to the 2nd browser window...or some way to re-authenticate without having the user log on again...possibly some mod_osso set-up...or some additional code? TIA.

    Hi Durairaj,
    The thing is that I did not get the desired answer to my query and the thread was posted in a wrong forum thus I have the query again inthe correct forum.
    Regards,
    Sweta.

  • Open a new browser window to show document

    Hi,
    I am trying to click an item in datagrid to open a new
    browser window and display the document for this selected item. how
    to implement it? thank you.

    Here is a full example that should do what you are asking.
    You need to create an itemRenderer for your DataGrid.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    backgroundAlpha="0" >
    <mx:Script>
    <![CDATA[
    import mx.collections.*;
    private var catalog:ArrayCollection;
    private static var contacts1:Array = [
    {URL: "
    http://www.macromedia.com/software/dreamweaver/",
    Product: "Dreamweaver"},
    {URL: "
    http://www.macromedia.com/software/flash/",
    Product: "Flash"},
    {URL: "
    http://www.macromedia.com/software/coldfusion/",
    Product: "ColdFusion"},
    {URL: "
    http://www.macromedia.com/software/flex/",
    Product: "Flex"},
    {URL: "
    http://www.macromedia.com/software/breeze/",
    Product: "Breeze"},
    {URL: "
    http://www.macromedia.com/software/director/",
    Product: "Director"}
    private function initCatalog(cat:Array):void
    catalog = new ArrayCollection(cat);
    myDatagrid.dataProvider = catalog;
    public function generateHtml(url:String):String {
    return '<a href="'+url+'"
    target="_blank">'+url+'</a>';
    ]]>
    </mx:Script>
    <mx:Text text="This example uses a Text itemRenderer for
    the second column that
    changes the font color of those cells and uses the htmlText
    property of Text
    to make the cell a link." width="350" />
    <mx:DataGrid id="myDatagrid" width="600" height="300"
    creationComplete="initCatalog(contacts1)" >
    <mx:columns>
    <mx:DataGridColumn dataField="Product" />
    <mx:DataGridColumn dataField="URL" width="400">
    <mx:itemRenderer>
    <mx:Component>
    <mx:Text color="0x0000FF"
    htmlText="{outerDocument.generateHtml(data.URL)}"/>
    </mx:Component>
    </mx:itemRenderer>
    </mx:DataGridColumn>
    </mx:columns>
    </mx:DataGrid>
    </mx:Application>
    Joan Lafferty
    Flex SDK QA

  • Displaying PDF in new Browser window

    Hi all,
    I have a question about displaying a invoices in pdf format in a new window. I read several threads about this, but I haven't been able to solve my problem.
    I'm using following code:
    append the pdf to the response
      cl_wd_runtime_services=>attach_file_to_response(
        i_filename  = 'test.pdf'
        i_content   = lx_pdf
        i_mime_type = 'application/pdf'
        i_in_new_window = ' X'
        i_inplace       = 'X' ).
    The content (lx_pdf) is retrieved from a smartform, via the function module for the smartform in question, after which I convert the OTF Data (JOB_OUTPUT_INFO-OTFDATA) to XSTRING using FM SCMS_TEXT_TO_XSTRING. The returned data (buffer of type xstring) I use for afore mentioned method. But all I get to see is the following:
    //XHPLJIIID    0700 00000000001
    IN04EZZ_MO_SMARTFORM_TEST
    IN05TEST_PAGE_1
    OPDINA4   P 144  240 1683811906000010000100001
    IN06MAIN
    IN06TEXT_TEST1
    MT0168902156
    CP11000000E
    FCCOURIER 120  00144 SF001SF001110000144E
    UL +0000000000000
    CT00000000
    ST0590441This is a text page for displaying PDF in a
    MT0168902396
    ST0547238new window
    MT0168902636
    ST0460832called from within a WD application
    MT0168902876
    ST0144010Application
    EP
    The text is correct, but it is not displayed as PDF in new window, and of course I'm not interested in all the formatting codes in front of every line??
    I should be possible to display a pdf in a new browser window without having installed everything needed for Adobe Interactive forms, or isn't it??
    Kind regards,
    Micky.

    Hi Micky.
    If you have the spool number of the printed billing document you can use
    component WDK_SPOOL_TO_PDF in order to display spool as PDF.
    Just transfer spool number and format to default inbound start up plug.
    Cheers,
    Sascha

  • Want to open a new browser window and display the html file in locale disk.

    Hi,
    I want to open a new browser window and display the html file in local drive. The below html applet work in local system successfully. But i deploy the same in web server (Tomcat) and try the same in client machine it does not work. Please help.
    Note:
    The class below fileopen.FileOpen.class i make it as a jar and put it in jre\ext folder at the client machine.
    ------------------------------------FileOpen.html(Tomcat)-----------------------------------------------------
    <html>
    <body >
    <applet code="OpenFile.class" archive="loadfile.jar" width="100" height="100">
    <param name="path" value="file://c:/open.html" />
    </applet>
    </body>
    </html>
    -------------OpenFile.java in server(Tomcat)--------------------------------------------
    public class OpenFile extends Applet implements ActionListener{
    String path = "";
    fileopen.FileOpen open = null;
    Button b = null;
    public void init(){
    path = getParameter("path");
    b = new Button("Open");
    b.addActionListener(this);
    add(b);
    public void actionPerformed(ActionEvent ae){
    try
    open = new fileopen.FileOpen(this,path);
    catch (Exception e){
    e.printStackTrace();
    -------------------------------------------FileOpen.java /Client JRE/ext----------------------------------------------------
    package fileopen;
    public class FileOpen
    AppletContext context = null;
    URL url = null;
    public FileOpen(Applet applet,String path)
    try
    if(null != applet){
    context = applet.getAppletContext();
    if (null != path)
    url = new URL(path);
    context.showDocument(url, "_blank");
    }catch(Exception ex)
    ex.printStackTrace();
    Please help to solve this issue very urgent.
    Thanks in advance.
    By,
    Saravanan.K.

    zzsara wrote:
    I want to open a new browser window and display the html file in local drive. ...Did you ever pause to consider how ridiculous that is?
    The best audience for applets is people off the internet. 'People off the internet' might be using a computer that has no (what was it?) 'open.html' in the root of the C: drive. In fact (shock horror) they may not even be running Windows, and would therefore probably have no 'C:' drive at all.
    If you do not intend to distribute this to people off the web, an application makes a lot more sense, but even then, you cannot rely on the document being there unless you 'put it there' (during installation, for instance).
    As the other poster intimated, applets can load documents off the local disk as long as they are trusted. Here is an example*, but note that it is not so rash as to presume any particular path or file, and instead leaves it to the user to choose the document to display.
    * The short code can be seen at SDNShare on the [Defensive Loading of Trusted Applets|http://sdnshare.sun.com/view.jsp?id=2315] post.
    On the other hand, a sandboxed applet can load any document coming from its own server via URL, or get showDocument(URL) to work. In that case, the JRE must recognize that the URL is from its own server, so the best way to form URLs for applet use is via the URL constructor
    new URL(getDocumentBase(), "path/to/open.html");That is how I form the URL in this [ sandboxed example of formatting source|http://pscode.org/fmt/sbx.html?url=/jh%2FHelpSetter.java&col=2&fnt=2&tab=2&ln=0]. Of course, in this case the applet loads the document, then parses the text to draw the formatted version, but the point is that an URL produced this way will work with showDocument(URL).
    I am pretty sure showDocument() in an applet off the internet will work with an URL pointing to a foreign (not its own) server, but it will not be able to load documents off the end user's local disks.
    I suggest a couple of things.
    - Try to express this problem in terms of what feature it is that you want to offer the end user. Your question jumps directly to a bad strategy for achieving ..who knows what? An example of a feature is "Shows the applet 'help' files on pressing F1".
    - A good way to indicate interest in a solution is to offer [Duke stars|http://wikis.sun.com/display/SunForums/Duke+Stars+Program+Overview] to match that interest.
    Edit 1:
    ..and please figure out how to use the CODE tags.
    Edited by: AndrewThompson64 on Sep 12, 2008 11:14 PM

  • Portlet Item Attr: "Link That Displays Item in New Browser Window"

    I have been searching the forums for a similar experience, but haven't found anything quite like this:
    I have a couple of portlets. One is a Discoverer Portlet, the other is something more basic: The "Developer News" portlet from the 9iAS Community portlet provider.
    After defining the portlets and looking at them, I edit the page and click the Edit button (little pencil) to edit the attributes.
    There are radio buttons for Display Options.
    One option is: "Link that Displays Item in New Browser Window."
    When I select this, OK, and then go back to the page, **the portlet doesn't show at all any more! There is no link, no nothing. Note that I have defined a Display Name, which should be the text for the link.
    It would seem that this feature flat out doesn't work.
    This technique for a popup works fine for an "Item" defined in an item region.
    Anyone?

    Yes -- I did do that after reading an article on metalink about such issues.
    This actually changes the problem.
    When I add the "Display name and image link" attribute to the region, I now do get a link.
    However, clicking it brings up an undefined Discoverer portlet.
    It works great for non-Disco portlets. For instance, I was able to pop up the "Developer News" portlet from the Oracle 9iAS Community portlet provider.
    I think the problem is that the link that Disco produces does not provide enough information to bring up the particular portlet. For instance, the URL does not have the workbook name, the worksheet name, the parameter values, etc.
    If anyone uses Disco w/ the portal, I would be curious to hear if anyone can reproduce this apparent bug / limitation.

  • How to make firefox open a URL in a PDF document which is loaded using Adobe PDF viewer in firefox to always in a new browser window ?

    Hi
    I have a web application which would enable users to see a list of PDF document on the web page and when the user select the PDF document, it will be open by a adobe PDF viewer.
    Within the content of the PDF document, it will contact URL links to some other portal web pages which we would like these other web pages to be open in a new browser window, but our testing shows that the new web pages may not always open in a new browser window.
    Could you help to advise how I can enforce that new web pages that are clicked from the PDF document can always be open in a new firefox browser window ?
    Thanks in advance.
    Regards
    Sen Lee

    Hello,
    In order to change the default reader for PDF files (to not open PDF files with Firefox's internal PDF reader), follow these steps:
    #Go to ''Tools'' > ''Options'' (or ''Firefox'' > ''Options'').
    #In the Options window, select the ''Applications'' tab.
    #In the ''Search'' field, type ''PDF''. You should find ''Portable Document Format (PDF)''.
    #On the right handside you should find an ''Action'' column. Use that to select your favorite PDF reader. In order to view PDF files in Firefox, choose ''Preview in Firefox''.
    Did this fix your problems? Please report back to us!
    Thank you.

  • File Open Issues - document library pdf file to open in new browser window

    Hi
    I have a requirement to open the document library containing pdf file to open in new browser window. So far I have tried following steps but could not get it to work.
    1. Changing Document library advance setting to open the document in browser (have tried others as well).
    2. SharePoint web application setting changed as Permissive instead of Strict. Here the pdf file opens in browser but redirect from document library instead of new window(Also tried adding Target=”_blank” and no change).
    3. Executed the powershell script to adding MIME type to see if it works but no change.
    $webApp = Get-SPWebApplication http://SharePointSite
    If ($webApp.AllowedInlineDownloadedMimeTypes -notcontains "application/pdf")
    Write-Host -ForegroundColor White "Adding PDF MIME Type..."
    $webApp.AllowedInlineDownloadedMimeTypes.Add("application/pdf")
    $webApp.Update()
    Write-Host -ForegroundColor White "Added and saved."
    Else
    Write-Host -ForegroundColor White "PDF MIME type is already added."
    4. Open the Doc library and modified ALLItems.aspx to add Target= “_blank”
    5. I have already tried solutions suggested in the link:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/9db08c4a-b53c-419a-84f8-001c194d1311/how-to-open-sharepoint-document-library-pdf-file-in-new-window?forum=sharepointadminlegacy
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/530e2ea1-d77d-491c-935f-04f536e439a5/open-a-pdf-document-to-a-new-browser-in-the-document-library-web-part?forum=sharepointadminlegacy
    http://mindsharpblogs.com/todd/archive/2005/08/16/654.html
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/7b6091df-4657-4799-ba02-259ebd7e4b7c/pdf-doesnt-open-in-document-library?forum=sharepointadminlegacy
    Appreciate if there are any working solution from any of you. Many Thanks

    I found a solution which works only in the development. No idea when I compared, Browser MIME type is enabled, STRICT browser type is configured for web application. on the document library advance setting, default to open in new browser. Both configurations
    are identical but I am able to open pdf file in new window in my developing using jquery script
    http://blog.ithinksharepoint.com/2011/02/21/open-pdf-files-from-a-document-library-in-a-new-window/ but the same does not work on production server :(
    Any help experts?
    Thanks

  • Display Integrated Oracle Report in New Browser Window

    Hi All,
    I am using APEX 3.0.1 and Reports Builder 10g and have integrated my Oracle Reports (.rdf) successfully with APEX.
    The trouble is that the report output (in PDF format) is opening in the same browser window as my APEX application and I would like to spawn a new browser window to display the report output.
    The report is being called from a button with a Target of URL and the URL Target is:
    &REPORTS_URL.&module=DEBITNOTE_REP.rdf&destype=cache&desformat=pdf&P_DEBITNOTEID=&P73_DEBITNOTEID.
    Kind Regards,
    Gary.

    Hi Garry,
    Had to do the same thing last week.
    1. Create a javascript function that accepts the report parameters and calls the window.open function for the reports URL
    2. Change the URL on the report button to call this new function
    It might also be worth using a cmdfile (see reports doco) to simplify the URL
    cheers,
    Ron

  • Download blob as pdf. Display inline in new browser window

    I am using the standard functionality of loading blob data, using a browse/upload item, and retrieving blob data using a report on a blob column. One of the settings when setting up upload and retrieval column attributes is called "CONTENT DISPOSITION". If I set it to "INLINE" the file downloads when clicking the "DOWNLOAD" link and displays in the appropriate viewer, e.g. for PDFs it's the browser window. How do I get the PDF file to display in a NEW browser window so the user does not have to leave apex?
    Paul P

    Alternatively, do pdf's already render in the browser window?
    http://www.mydigitallife.info/2007/06/17/disable-pdf-from-opening-in-web-browser-ie-firefox-opera-safari/
    Trent

  • Link That Displays Item In New Browser Window

    Hi,
    We use Oracle Portal Version: 10.1.4.0.0 (Build: 594).
    We've found that the following setting doesn't seem to work.
    Link That Displays Item In New Browser Window
    Even with that set on items, items ALWAYS open up in the same window,..not a new one.
    Has anyone else experienced this or is it just us?
    thanks

    Hi, this is a "bug". You need patch 5026969 to solve it.
    More info is in note 358722.1 - Items Are Opened In The Same Browser Window Even Though The Option 'Link That Displays Item In New Browser Window' Is Set.
    Regards, JW

  • Load balancing 10g forms - Connection from new browser window not supported

    Load balancing 10g forms - Connection from new browser window not supported
    We're experimenting with using webcache to load balance between multiple applications servers running OC4J forms processes.
    We currently have one machine with infrastructure and mid-tier (BI & Forms) installed, which is being used for the webcache functionality, this is load balancing between 2 other servers each of which just have the mid-tier (BI & Forms) installation
    In order to get this to work, I had to follow the instructions in the Forms deployment guide : http://download-uk.oracle.com/docs/cd/B14099_11/web.1012/b14032/tuning.htm#sthref707
    The main gist of this is that you need to set the following in the orion-web.xml file in order that the sessions are maintained:
    <session-tracking
    cookies="enabled">
    </session-tracking>
    This all works fine in most cases.
    The problem I am having is if I do one of the following on the client machine:
    1) From IE6 / IE7 run a copy of a forms application. Then open a new window using the "New Window" menu option, and attempt to run another forms application.
    2) In IE7 or Firefox 2.0 open a copy of the forms application, and then open a new tab and try and open another forms application.
    If I try either of these I get a FRM-92101 error, and the following is displayed in the java console:
    oracle.forms.net.ConnectionException: Connection from new browser window not supported
    From trawling various forums (including metalink and otn) it looks like a problem with the way coockies are handled.
    Unfortunately the usual workaround is to ensure that the session tracking option in the orion-web.xml file is disabled.
    The problem is that I need this enabled in order for the load balancing to work.
    Does anyone know of any other workarounds or patches that might help resolve this?
    We're using Application server 10.1.2.0.2 running on windows 2003 servers.

    You were right. Carriage returns were stopping it from working (the document is laid out over separate lines, so I assumed it would make no difference...).
    I've now managed to get it so the forms at least run, but they are all being run in the forms OC4J instance on the same machine as the OHS.
    Has anyone actually managed to get this to work, or am I doing something wrong?
    I did wonder if using an OHS instance on a machine with no forms installation would make any difference?
    I had raised a support call via metalink on this subject, but they eventually came to the conclusion that the only way to do this is with a hardware load balancer (Despite several documents suggesting that webcache is the way to go (including the forms deployment manual)).
    I'm at the point now of giving up and writing some custom scripts to do the job instead...

Maybe you are looking for

  • Assistance needed with migration from OSMF 1.0 to OSMF 2.0

    I am using a third party plug-in for HTTP Live Streaming playback, http://code.google.com/p/apple-http-osmf/ Porting the plug-in from OSMF 1.0 to OSMF 2.0 did not go as smoothly as I had hoped. A change in behaviour between OSMF 1.0 and OSMF 2.0 is c

  • Special Characters in Create Table......

    How can I use & sign in the column name in Create Table Statement: Create Table (aa&bb varchar2(10));

  • Antivirus interfering with Photoshop CS3

    For some time now I have been suffering from frequent lockups of my computer when trying to run Photoshop CS3 and or Bridge CS3. I have traced the problem to my antivirus program (Steganos AV2009 aka AVG8). If I disable the Resident Shield component

  • Built in isight crashing imovie

    Everytime I capture something using the built-in isight I get this error message. What's more video no longer works with Skype (dispite complete re-install). Process: iMovie [330] Path: /Applications/iMovie.app/Contents/MacOS/iMovie Identifier: com.a

  • Lite-On Combo Drive not detected

    Allo, I'm using a K7N2 Delta MS-6570 for my motherboard and I've been having some minor problems with combo drives. I had the same problem with a memorex drive and now with a lite-on drive. DVD-ROM/CD-RW. When I turn on or restart the computer window