Help..How do I redirect a function like xmldoc.print(System.out); to a StringBuffer??

I am trying to take a existing function that takes an OutputStream and redirect to a StringBuffer instead of Sytstem.out. Could someone please give me an example of this?

StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
String swb = sw.getBuffer().toString();
I used the following technique and posted it here to help anyone who needs it. I simple wrote to pw instead of System.out and retrieved the buffer at the end.

Similar Messages

  • How to implement a back functionally like the back of the browser

    Hi, I have a commandImageLink("go back") in a template jspx. How to implement the back functionally like the back of the browser with a managed bean method??. For know I m not using task flows.

    I think you can use a javascript method to go back to the previous browser page.
    http://javascript.about.com/library/blback.htm
    http://www.pageresource.com/jscript/jhist.htm
    http://www.w3schools.com/jsref/met_his_back.asp
    Perhaps you find something useful and related to backing beans here:
    http://adfdevelopers.blogspot.com/2009/04/some-handy-code-for-backing-beans-adf.html
    NA
    http://nickaiva.blogspot.com

  • Help - How do I create a template like this?

    Hi there,
    Can anyone tell me how to create a template website like this
    where the text and images are placed into odd shapes as opposed to
    boring 'awl AP DIVS.
    Many thanks for any help!
    Here's the website I'm talking about:
    www.agaveny.com

    thanks a mill but can you expand on that? how do I go about
    recreating a template like that? how can you have different lengths
    and widths for each rectangle? I don't get it - HELP!

  • How to reverse menu or function exclusions for a system defined responsibility like System Administrator??

    Hi Experts,
    One of our students have excluded the responsibility define function and user define function from the "System Administrator" responsibility in our test instance, which resulted in disabling of responsibility creation and user creation form.  Can anyone here explain how to resolve this issue??
    Thanks.

    Your DBA should be able to help you..........

  • How to debug a remote function module in calling system? Help!

    Hi Experts,
       I have a ABAP report (in System A) from where I am calling a remote function module which exists in a different system B.
    ABAP Program(System A)<----calls--
    RFC(System B)
    Can I debug the RFC funnction module in system A using ABAP debugger? In other words if i put a breakpoint on the "call function" statement then in debug mode I want to see that the control is going to system B and I should be able to process the FM code line by line. Is this possible?
    Is there any special transaction or settings?
    Is there any alternative?
    Please help
    Thanks
    Gopal

    hello,
    Try this method.
    first check whether RFC connection is working b/w 2 systems.
    if connection is working, then do like this.
    In System B , put endless loop in FM before some main select statement.
    like
    DATA : v_a TYPE c VALUE space
    DO  .
       IF v_a = 'X'.
         EXIT.
       ENDIF.
    ENDDO.
    the above code will be endleep loop.
    In system A, when cursor goes to CALL FUNCTION DESTINATION 'XXXXX'.
    u shud be logged in system B. the moment control comes to system B.goto tcode SM50 . check ur username . choose that particular  checkbox then in menu bar --> program/session --> Program --> Debugging.
    i hope it will help u.
    try & let us know.
    Thanks,
    Manjunath MS

  • MSI installation, how to disable the online functions (like Cloud and login)?

    How can I disable the online functions which need a login with the adobe id? I want to do this while I install the Adobe Reader DC with the MSI installer.

    Hi Yannic,
    I can understand your concern, however Document Cloud is a core part of Adobe Acrobat Reader DC and Adobe Acrobat DC so it cannot be disabled. If you don't want to use this feature then you don't need to sign in.
    If you really feel that this does not suites your requirement then you can uninstall it & re-install Adobe Reader 11 Adobe Acrobat Reader DC Install for all versions.
    Let me know if you have any further queries.
    Regards,
    Aadesh

  • How to get Excel to function like InfoPath with SharePoint libraries?

    When working with InfoPath, there is a way to promote fields from your form to a SharePoint Library so that when you submit the form, it submits the actual form and the metadata from the fields in the form to columns in the document library in SharePoint.
    Well, I'm trying to accomplish this with Excel, but am so used to doing it with InfoPath I'm running into a lot of walls. I've found an add-in that allows me to insert a table and publish/sync it to a library in SharePoint, so that data from that table is
    sent to the library.
    Trouble is, I need the spreadsheet to also be "submitted" to the library so I can send it to specific users  based on a workflow. So basically, I need metadata from the form to be sent to the library for the purpose of triggering the workflow so that
    it routes the spreadsheet to the correct user. But in order for it to route (or provide a link to the spreadsheet in the workflow email) the sheet, it also needs to get submitted to the library.
    So I'm trying to get InfoPath functionality out of this.

    Excel does not integrate with SharePoint like that.  Is there a reason you're dealing with entire spreadsheets instead of converting them to lists and/or using InfoPath for form purposes?
    SharePoint Architect || Microsoft MVP ||
    My Blog
    Planet Technologies ||
    SharePoint Task Force
    Actually, it does. You can promote fields from Excel, InfoPath, etc. to SharePoint and use them to do exactly what I was looking to do above. I actually did this for a huge project and it worked.
    And yes, the Excel spreadsheets have an addin that is required for the business process on the client side.

  • How do reset my mac? I have a mac that is nulled and cannot open anything except finder and system preferences. I don't have any cd's. How can I completely reset it like it just came out of the box?

    Hey, can someone please help me my mac is nulled.

    If you are running 10.6.8 as shown in your profile, there is no recovery option as that did not become available until 10.7. So you would need your install disks or a bootable clone to boot from. You can usually get replacement disks from Apple; however, you would need to give them your serial number so they send the correct disks.

  • I would like to know what application I should use for this specific job.  I have 6 photos in Iphoto, and I would like to print them out on one piece of paper with the title and key words showing.  Please help.

    My objective is to print photos on on 8 1/2 x 11 sheets of paper (4 per page).  I want to include the photo title and the photo key words.
    I am not sure how to go about doing this.

    In iPhoto, create an album with the images you want to print.
    Once created, open the album and select all the images (type Command + A)
    Go to the menu View and make sure Titles and Keywords are checked.
    Go to the menu File > Print
    Choose Contact Sheet
    In the lower right corner press the customize button
    In the next window that opens, at the bottom of the window change the column slider to "2"
    You should be good to go. If OK, then press Print at the bottom right corner of the window.
    MtD
    Message was edited by: Meg The Dog to fix typo

  • How do you copy a text message and print it out?

    Hi i'm trying to print out so text messages from 2 people ,how do i do this?

    Copy/Paste to notes; then print, Copy/Paste to email; send to yourself; then print, or use third-party software to extract from your phone, then print:
    http://www.wideanglesoftware.com/touchcopy/index.php

  • How to trace the form functions

    Can some help me how to trace the form functions like who has executed the function and when it has been exectued.
    Please let me know if a table is already exists for tracing the form functions.

    I am not sure that this would serve the purpose or not but still, I guess its worth to atleast be mentioned,
    http://www.oracle-base.com/articles/9i/DBMS_TRACE.php
    HTH
    Aman....

  • How do i create this function?

    How do i create a function like this "attached" so that when a customer decides he likes a different color, he can just click the link with the dot or symbol next to the color name.

    Attachments never make it to the forums - some bug or other.
    If you want to attach an item, please use the smal camera icon in the top toolbar instead.

  • How do I get System.out.format to print out doubles with the same precision

    Using the System.out.format, how do I print out the value of a double such that it looks exactly like it does if it were print from a System.out.println.
    For example, take the following code:
    double d = 12.48564734342343;       
    System.out.format("d as format: %f\n", d);
    System.out.println("d as   sout: " + d);Running the code, I get:
    <font face="courier">
    d as format: 12.485647
    d as sout: 12.48564734342343
    </font>
    The precision of d has been lost.
    I could bump up the precision as follows:
    double d = 12.48564734342343;
    System.out.format("d as format: %.14f\n", d);
    System.out.println("d as   sout: " + d);That appears to work, I get:
    <font face="courier">
    d as format: 12.48564734342343
    d as sout: 12.48564734342343
    </font>
    However, that solution fails if d has a different precision, say 12.48. In that case I get:
    <font face="courier">
    d as format: 12.48000000000000
    d as sout: 12.48
    </font>
    So how do I get System.out.format to print out doubles with the same precision as System.out.println?
    Thanks..

    YoungWinston wrote:
    Schmoe wrote:
    Interesting, but this is not what I am looking for...Your original question was "how do I print out the value of a double such that it looks exactly like it does if it were print from a System.out.println", and you've been told how to do that (although the pattern given by sabre may be a bit excessive - you should only need 15 '#'s).The initial phrase from my question was "Using the System.out.format, how do I..".
    It's worth remembering that, unlike the Format hierarchy, 'format()' is NOT native to Java. It's a convenience implementation of the 'printf()' and 'sprintf()' methods provided in C, and first appeared in Java 1.5. Those methods were designed to produced fixed-format output; 'println()' was not.Perhaps it is the case that this can't be done.
    Furthermore, Double.toString(), which is what is used by println() does not produce the same format in all cases; format("%.14f\n", d) does. TrySystem.out.println(1.8236473845783d);
    System.out.println(1823647384.5783d);and you'll see what I mean.I am fine with that. It still displays all the precision.
    I am simply looking for a way to quickly print out multiple variables on a sysout while debugging. I want it as syntactically sweet as possible. System.out.println can be a pain when outputting multiple variables like the following:
    "System.out.println("a: " + a + "; b:" + b + "; c: " + c);"
    For some reason, my fingers always typo the plus key.
    I was hoping that System.out.format would be easier,along the lines of:
    "System.out.format("a: %f, b: %f, c: %f\n", a, b, c);"
    From a syntactical sweetness point of view, it is easier. However, the %f on doubles truncates the precision. I figured there must be a way to get the full precision.
    DecimalFormat is syntactically sour for this purpose, as you need to instantiate the DecimalFormat.
    fwiw I have enjoyed reading the suggestions in this thread...

  • How do I watch my iTunes movies, tv shows on my mac without having to download them all to my HD?  I really want my Mac to function like my Apple TV since I have just moved and don't have my TV for another few weeks. Help please?

    How do I watch my iTunes movies, tv shows on my mac without having to download them all to my HD?  I really want my Mac to function like my Apple TV since I have just moved and don't have my TV for another few weeks. Since I purchased my three Apple TV. I have had no need to download any of my movies to my Mac.  Which has been great.  However, I remember that I used to now have to do this... or did I?  I am just frustrated because I want to stream all this stuff vice haveing to waiting for it all to download fill up my Mac's HD and then just delete. Someone help please?

    Play the movie in iTunes to stream it.
    Click the cloud icon to download it.

  • How to use an external start button for 6024E w/ sc-2345, I would like it to function like a start button in LabView but I don't know how to connect the external button to the sc-2345's connector block

    I am confused as to how to connect my external start botton. I would like it to function like a start button on a front panel of a VI. I would like to use the +5V on pin 14 but I really don't know where to go from here. Any guidence for a novice would be most appreciated.

    phod,
    This is the LabVIEW Real-Time forum, so I suggest that in the future that you post this type of question to the Multifunction DAQ forum.
    For the simplest solution you will have to connect your button to a digital line of your board, consult the sc-2345 user manual for a diagram of where these lines are exposed. You will have to connect your start button in series with a line that is high, such as your 5V pin or another digital line. Then connect this to a digital line that will be your start trigger.
    Your program can poll the digital line that is connected to your button in a while loop and when it goes high, it lets the rest of the program execute. For the programming, I suggest you take a look at the shipping examples that come with LabVIEW. If yo
    u have LabVIEW 7.0 go to Help>>Find Examples. Open Hardware Input Output>>Traditional DAQ>>Digital Input and Output>>E Series for some examples of digital I/O programming with E-series boards.
    Hope that gets you started.
    Gerardo

Maybe you are looking for

  • Error in generating SID for 0Requid (187.98)

    Hi All, We have transported requests into the Quality and when iam trying to run the infopackage for master data through flat file, it pops up this erro msg which says "Error in generating SID for 0REQUID (187.98)". This is the case with all master d

  • 110V vs 220v for Time Capsule?

    I bought my Time Capsule in USA, now I am in europe, do I need to get a transformer for 220V to 110 V or just change the power cord?

  • Why upgrade to Yosemite?

    I have the good fortune of knowing why not to upgrade. I had Mavericks already and I decided an upgrade might help fix some intermittent problems with my OS, like drag/drop being on/off. Since upgrading to Yosemite: Finder will not overwrite files (s

  • Why drop-down menu not working on Mac with Firefox.

    I am trying to go to my credit union home page. They have drop down menus that do not work on my Mac with Firefox. They menu works fine on a PC but not the MAC.

  • F2105

    I have an f2105 monitor.  The power light is on, the drivers are up to date, and the VGA cord has been tested.  The monitor comes on and the blue light stays on however, i only get a display for about 1 second and then the screen goes black yet the p