How can I put an output stream (HTML) from a remote process on my JSF page

Hello,
I've a question if someone could help.
I have a jsf application that need to execute some remote stuff on a different process (it is a SAS application). This remote process produces in output an html table that I want to display in my jsf page.
So I use a socket SAS class for setting up a server socket in a separate thread. The primary use of this class is to setup a socket listener, submit a command to a remote process (such as SAS) to generate a data stream (such as HTML or graphics) back to the listening socket, and then write the contents of the stream back to the servlet stream.
Now the problem is that I loose my jsf page at all. I need a suggestion if some one would help, to understand how can I use this html datastream without writing on my Servlet output stream.
Thank you in advance
A.
Just if you want to look at the details .....
// Create the remote model
com.sas.sasserver.submit.SubmitInterface si =
(com.sas.sasserver.submit.SubmitInterface)
rocf.newInstance(com.sas.sasserver.submit.SubmitInterface.class, connection);
// Create a work dataset
String stmt = "data work.foo;input field1 $ field2 $;cards;\na b\nc d\n;run;";
si.setProgramText(stmt);
// Setup our socket listener and get the port that it is bound to
com.sas.servlet.util.SocketListener socket =
new com.sas.servlet.util.SocketListener();
int port = socket.setup();
socket.start();
// Get the localhost name
String localhost = (java.net.InetAddress.getLocalHost()).getHostAddress();
stmt = "filename sock SOCKET '" + localhost + ":" + port + "';";
si.setProgramText(stmt);
// Setup the ods options
stmt = "ods html body=sock style=brick;";
si.setProgramText(stmt);
// Print the dataset
stmt = "proc print data=work.foo;run;";
si.setProgramText(stmt);
// Close
stmt = "ods html close;run;";
si.setProgramText(stmt);
// get my output stream
context = FacesContext.getCurrentInstance();
HttpServletResponse response = (HttpServletResponse) context.getExternalContext().getResponse();
ServletOutputStream out = response.getOutputStream();
// Write the data from the socket to the response
socket.write(out);
// Close the socket listener
socket.close();

The system exec function is on the Communication palette. Its for executing system commands. On my Win2K system, the help for FTP is:
"Ftp
Transfers files to and from a computer running an FTP server service (sometimes called a daemon). Ftp can be used interactively. Click ftp commands in the Related Topics list for a description of available ftp subcommands. This command is available only if the TCP/IP protocol has been installed. Ftp is a service, that, once started, creates a sub-environment in which you can use ftp commands, and from which you can return to the Windows 2000 command prompt by typing the quit subcommand. When the ftp sub-environment is running, it is indicated by the ftp command prompt.
ftp [-v] [-n] [-i] [-d] [-g]
[-s:filename] [-a] [-w:windowsize] [computer]
Parameters
-v
Suppresses display of remote server responses.
-n
Suppresses autologin upon initial connection.
-i
Turns off interactive prompting during multiple file transfers.
-d
Enables debugging, displaying all ftp commands passed between the client and server.
-g
Disables file name globbing, which permits the use of wildcard characters (* and ?) in local file and path names. (See the glob command in the online Command Reference.)
-s:filename
Specifies a text file containing ftp commands; the commands automatically run after ftp starts. No spaces are allowed in this parameter. Use this switch instead of redirection (>).
-a
Use any local interface when binding data connection.
-w:windowsize
Overrides the default transfer buffer size of 4096.
computer
Specifies the computer name or IP address of the remote computer to connect to. The computer, if specified, must be the last paramete
r on the line."
I use tftp all of the time to transfer files in a similar manner. Test the transfer from the Windows command line and copy it into a VI. Pass the command line to system exec and wait until it's done.

Similar Messages

  • How can i put music on my ipod from bearshare

    hi how can i put music on my ipod from bareshare???

    Q.
    Can I load my BearShare subscription music onto my iPod?
    A:
    No, Apple's iPod cannot play music encoded in WMA (Microsoft's Windows Media Audio format) which is the format used by BearShare.
    For more help on this topic, Click here."
    http://www.bearshare.com/help.html#15

  • When I try using Airplay to stream from Amazon Prime it tries to use Apple TV music.  How can I get it it stream movies from Amazon Prime?

    When I try using Airplay to stream from Amazon Prime it tries to use Apple TV music.  How can I get it it stream movies from Amazon Prime?

    Welcome to the Apple Community.
    Try the following steps, check whether things are working after each step where appropriate, before trying the next.
    Restart the Apple TV (Settings > General > Restart).
    Restart the Apple TV by removing ALL the cables for 30 seconds.
    Restart your router.
    Reset the Apple TV (Settings > General > Reset > Reset all settings)
    Restore the Apple TV (Settings > General > Reset > Restore)

  • I have had a PC, and now a MacBook. How can I put my archives of mails from my PC to my MacBook ? Thank's

    Hi,
    I have had a PC, and now a MacBook. Do you know how can I put my archives of mails from my PC to my MacBook ? Thank's

    O2M from Little Machines http://www.littlemachines.com/
    Stefan

  • How can servlet return the output as html content with drawing picture?

    Does anybody know how can a servlet return the output as html content with drawing picture?
    The drawing picture is drawn at runtime by the servlet.

    Thanks, BalusC.
    But I am not sure if I understand your reply fully.
    From my understanding, you are telling me to first generate a html from a servlet with the image <IMG> tag pointing to a servlet which will be responsible to generate an image?
    For example, <IMG SRC="http://myserver/servlet/testservlet">
    Could you confirm this?

  • How can I put all output error message into a String Variable ??

    Dear Sir:
    I have following code, When I run it and I press overflow radio button, It outputs following message:
    Caught RuntimeException: java.lang.NullPointerException
    java.lang.NullPointerException
         at ExceptionHandling.ExceptTest.actionPerformed(ExceptTest.java:72)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
         at javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:291)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
         at java.awt.Component.processMouseEvent(Component.java:6038)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
         at java.awt.Component.processEvent(Component.java:5803)
         at java.awt.Container.processEvent(Container.java:2058)
         at java.awt.Component.dispatchEventImpl(Component.java:4410)
         at java.awt.Container.dispatchEventImpl(Container.java:2116)
         at java.awt.Component.dispatchEvent(Component.java:4240)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
         at java.awt.Container.dispatchEventImpl(Container.java:2102)
         at java.awt.Window.dispatchEventImpl(Window.java:2429)
         at java.awt.Component.dispatchEvent(Component.java:4240)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)Caught RuntimeException: java.lang.NullPointerException
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)I hope to catch all these error message into a String Variable such as StrErrorMsg, then I can use System.out.println(StrErrorMsg) to print it out or store somewhere, not only display at runtime,
    How can I do this??
    Thanks a lot,
    See code below.
    import java.awt.Frame;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.io.FileInputStream;
    import javax.swing.ButtonGroup;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JRadioButton;
    public class ExceptTest extends JFrame implements ActionListener {
        private double[] a;
      private JRadioButton divideByZeroButton;
      private JRadioButton badCastButton;
      private JRadioButton arrayBoundsButton;
      private JRadioButton nullPointerButton;
      private JRadioButton negSqrtButton;
      private JRadioButton overflowButton;
      private JRadioButton noSuchFileButton;
      private JRadioButton throwUnknownButton;
      public ExceptTest() {
        JPanel p = new JPanel();
        ButtonGroup g = new ButtonGroup();
        p.setLayout(new GridLayout(8, 1));
        divideByZeroButton = addRadioButton("Divide by zero", g, p);
        badCastButton = addRadioButton("Bad cast", g, p);
        arrayBoundsButton = addRadioButton("Array bounds", g, p);
        nullPointerButton = addRadioButton("Null pointer", g, p);
        negSqrtButton = addRadioButton("sqrt(-1)", g, p);
        overflowButton = addRadioButton("Overflow", g, p);
        noSuchFileButton = addRadioButton("No such file", g, p);
        throwUnknownButton = addRadioButton("Throw unknown", g, p);
        getContentPane().add(p);
      private JRadioButton addRadioButton(String s, ButtonGroup g, JPanel p) {
        JRadioButton button = new JRadioButton(s, false);
        button.addActionListener(this);
        g.add(button);
        p.add(button);
        return button;
      public void actionPerformed(ActionEvent evt) {
        try {
          Object source = evt.getSource();
          if (source == divideByZeroButton) {
            a[1] = a[1] / a[1] - a[1];
          } else if (source == badCastButton) {
            Frame f = (Frame) evt.getSource();
          } else if (source == arrayBoundsButton) {
            a[1] = a[10];
          } else if (source == nullPointerButton) {
            Frame f = null;
            f.setSize(200, 200);
          } else if (source == negSqrtButton) {
            a[1] = Math.sqrt(-1);
          } else if (source == overflowButton) {
            a[1] = 1000 * 1000 * 1000 * 1000;
            int n = (int) a[1];
          } else if (source == noSuchFileButton) {
            FileInputStream is = new FileInputStream("Java Source and Support");
          } else if (source == throwUnknownButton) {
            throw new UnknownError();
        } catch (RuntimeException e) {
          System.out.println("Caught RuntimeException: " + e);
          e.printStackTrace();
          System.out.println("Caught RuntimeException: " + e);
        } catch (Exception e) {
          System.out.println("Caught Exception: " + e);
      public static void main(String[] args) {
        JFrame frame = new ExceptTest();
        frame.setSize(150, 200);
        frame.addWindowListener(new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            System.exit(0);
        frame.show();
    }

    yes, I update as follows,
    but not looks good.
    import java.io.*;
    public class UncaughtLogger implements Thread.UncaughtExceptionHandler {
        private File file;
        private static String errorMessage;
        public UncaughtLogger(File file) {
            this.file = file;
            //Thread.setDefaultUncaughtExceptionHandler(this);
        public UncaughtLogger(String str) {
            this.errorMessage = str;
            Thread.setDefaultUncaughtExceptionHandler(this);
        //@Override()
        public void uncaughtException(Thread t, Throwable e){
            try {
                log(e);
            } catch (Throwable throwable) {
                System.err.println("error in logging:");
                throwable.printStackTrace();
        private void log(Throwable e) throws IOException {
            PrintWriter out = new PrintWriter(new FileWriter(file, true));
            try {
                e.printStackTrace(out);
            } finally {
                out.close();
        private static UncaughtLogger logger = new UncaughtLogger(new File("C:/temp/log.txt"));
        private static UncaughtLogger logger2 = new UncaughtLogger(errorMessage);
        public static void main(String[] args) {
                String s1 = "Hello World!";
                s1 = null;
                String s2 = s1.getClass().getName();
                System.out.println(s1);
                System.out.println(s2);
                System.out.println("errorMessage =" + errorMessage);
    }

  • How can I retrieve old Photo Stream photos from a lost iPhoto Library?

    My laptop was stolen and with it an external drive that had my iPhoto library.  I had an old backup and when I opened the backup and turned on Photo Stream, I saw all my old photos appear again!  After a short while, it was removing old photos from the photostream and replacing them with newer ones.  I'm now missing months of Photo Stream photos that I really want back.  I tried creating a new library and enabling Photo Stream to try to capture those missing images, but I am not able to see anything older than Oct.  I could really use some help if somebody knows a way to get those memories back...
    Thanks
    -Rob

    I had an old backup
    What kind of backup? Do you have a Time Machine Backup of your complete system from the time before the laptop was stolen?
    To restore the Photo Stream images from that time you need to restore the folder
    your home folder /Library/Application Support/iLifeAssetManagement/Assets
    This folder contains the PhotoStream pictures that were part of the PhotoStream at that time.
    To restore this folder from TimeMachine, open a Finder window showing this folder, make it the active window, and then enter TimeMachine. Go back in time in the TimeTunnel, till you see the correct date. Don't restore to the library but to a folder on the Desktop.
    Regards
    Léonie

  • How can i make a css tab highligted incicating that i am in current jsf pag

    Hi
    i am creating jsf pages nad linking the pages thru css tabs. i am able to creat and link the tab.
    i want to higlight the tab of the current page in which i am.
    below is my code
    css code
    .navigation a
    color: #000;
    background: #fb0 url("../images/left-tab.gif") left top no-repeat;
    text-decoration: none;
    padding-left: 10px ;
    font-weight:bold;
    .navigation a span
    background: url("../images/right-tab.gif") right top no-repeat;
    padding-right: 10px
    .navigation a:link, .navigation a:visited, .navigation a:active
    {color: #fff; background: #bbb uurl("../images/left-tab.gif") left top no-repeat; font-weight:bold; padding-left: 10px}
    .navigation a:link span, .navigation a:visited span, .navigation a:active span
    {background: #bbb ("../images/right-tab.gif") right top no-repeat; padding-right: 10px}
    .navigation a, .navigation a span
    display: block;
    float: left
    .navigation a, .navigation a span
    float: none
    .navigation a:hover
    color:#F5FFFA;
    background: #26a url("../images/left-tab-hover.gif") left top no-repeat;
    text-decoration: none;
    padding-left: 10px
    .navigation a:hover span
    background: url("../images/right-tab-hover.gif") right top no-repeat;
    padding-right: 10px
    .navigation, .navigation ul
    list-style: none;
    padding: 0;
    margin: 0
    .navigation li
    float: left;
    display: block;
    margin: 0;
    padding: 0
    and in jsp file i am using as
    <h:panelGrid columns="2" styleClass="navigation">
    <ul>
    <h:column>
    <li><h:commandLink action="edit1003">
    <span><h:outputText value="#{msgs.edit1003}" styleClass="maintabtext"/></span>
    </h:commandLink>
    </li>
    </h:column>
    <h:column>
    <li> <h:commandLink action="aboutus">
    <span> <h:outputText value="#{msgs.aboutus}" styleClass="maintabtext"/></span>
    </h:commandLink>
    </li>
    </h:column>
    </ul>
    </h:panelGrid>
    some one please let me know how to highlight the current page do i need to use any javascript if so can some send me code snippet it would be greatful
    thansk in advance.
    sreedevi

    Did you get the solution for this. I seem to have the same problem.

  • How can we call a OSB proxy service from a BPEL process?

    Hi,
    I want to call a OSB proxy service from a BPEL process. Can you please explain me the procedure?

    Get the wsdl of the OSB proxy service and create webservice parnerlink in BPEL based on this wsdl to invoke the service
    To form the wsdl url, copy the Endpoint URI  configured to the proxy service(just click on the proxy service in the console) from the sbconsole  - /ATHGPUM_GlidePathService/ProxyService/ATHGPUM_GlidePathProxyService
    Pre append <<protocol://OSB Hostname:OSB Port>>  - http://localhost:8000/   and post append with ?WSDL
    The final WSDL url look like  - http://localhost:8000/ATHGPUM_GlidePathService/ProxyService/ATHGPUM_GlidePathProxyService?WSDL
    Regards
    Albin I

  • How can I put C files gave me from Matlab Simulink Real Time Workshop in a CIN?

    I'm doing a turbine simulation, and I've already done it in Matlab Simulink Real Time Workshop. It gave me files .c, and I want to use them to run the same simulation on a PCI 7030/6040 using LabView RT 5.1. I'm using the CINs. My problem is that I'm able to have .lsb files, but them don't work....I mean I have as output the same result 0(zero). What can I do for solving my problem?
    Thanks in advance!!

    Somehow, this question was posted twice on the same day. See the other posting of this same question for the answer.
    Chad H.
    Applications Engineering
    National Instruments
    http://www.ni.com/ask

  • HT1491 How can i put the song i downloaded from my phone to my iTunes?

    I downloaded a song from my iTunes on my iPhone 4, and its on my playlist of my phone but i want to upload it on my laptop, i don't know how and i don't know if its possible.

    under your Settings - Messages - Receive At (should be your phone number not your email address).
    If the Text message is blue, then its sending to another IOS device over iMessage. The above setting will make sure it is sent with your phone number.

  • How can i put customs dates/anniversary dates from my contacts into my iphone calendar?

    I have set up custom dates in my contacts as well as anniversary dates. I'd like to know if there is an app to import these dates into a calendar, it doesn't have to be the iphone standard calendar. I'd just like them to show up as a normal calendar entry, rather than having to add them manually into the calendar. Also, if you have an anniverary date in a contact, and then a relationship as "spouse" to another contact, does this not assume they will have the same anniversary date and therefore update their contact details with this event too ? I don't mind having to buy an app, but most of the ones i have read only add birthdays, and i want to ensure all the custom dates I have set up get imported. These are for friends children's details who don't have their own contact set up in my phone. Thanks, any help appreciated!

    View Purchase History
    http://support.apple.com/kb/HT2727

  • How can I access my Airport Time Capsule from a remote location?

    I have my 2 TB Airport Time Capsule connected to my home wireless network and I have heard it is possible to access my information stored on it from anywhere, but I have no clue how to do this.

    Frankly, this is not easy, and not for the faint of heart.  Having someone to help who has done this will save you a ton of time and headaches.
    Set up and use Back to My Mac - Apple Support
    Before you do anything though, Back to My Mac assumes that you have a simple modem......not a modem/router that is often provided by Internet Service Providers to their customers.  A modem/router.....also called a gateway.....will not allow Back to My Mac to work correctly, so if you do have a modem/router or gateway device, you will need to speak to your service provider to find out if they can provide you with a simple modem.
    A simple modem will look something like this:
    A modem/router or gateway will look something like this:
    Having said this, personally I use another method called Port Mapping to allow my Mac...or an iPhone or iPad connect back to the Time Capsule at home when I am traveling.  But, this is even more complicated than Back to My Mac, so BTMM would be the place to start for most users.
    If things look intimidating on first pass and you can locate a good tech to set things up for you, that would be money well spent.

  • How can I take a single selected image from a slideshow to pass  to another page?

    I have a slideshow of several images from which a user needs to select one (for example the image that is featured in a lightbox after cicking the thumbnail) and then go to another page for further details on that image, with the same image displayed again, and where I want to embed some html to offer further options based on that selected image. How do I pass the name of the object from one page to another? How do I detect that a user has selected an image?
    I have tried setting each image in the lightbox as a hyperlink to a new page, and also tried setting its caption as a hyperlink, but neither of those ideas seem to work (at least in Preview).
    Any suggestions please? I am working in Muse CC 2014.

    Creating a hyperlink from the text caption should work. Try previewing: File/Preview Site in Browser to test.
    (I tested it using both Preview and File/Preview Site in Browser and it did link to the page I assigned)

  • How can I put my icloud photos to camera roll or photo stream?

    I got a nee iphone, i backed up everything and restored it into mu new iphone, but the pictures didn't restore so i did it manually but now on my phone i got different albums icloud photo stream and camera roll. How can i put the icloud picture into camera roll or photo stream. Any ideas?? On my old iphone ive deleted everything.

    Hello Ozzie94,
    Thanks for the additional information. The camera roll is designed for photos taken on your device, or saved images from Mail and other applications. Photos synced from a computer are organized into their own album(s):
    View photos and videos - iPhone
    http://help.apple.com/iphone/7/#/iph3d267610
    - Camera Roll—photos and videos you took on iPhone, or saved from an email, text message, webpage, or screenshot
    - Shared photos and videos—Photos and videos that you’ve shared with iCloud Photo Sharing or that others have shared with you (see iCloud Photo Sharing)
    - Photos and videos synced from your computer (see Sync with iTunes)
    Additionally, you may find more information by using another one of Apple's support resources - https://getsupport.apple.com
    Thanks,
    Matt M.

Maybe you are looking for

  • How to store data into database by reading sql statements from text file

    how to write java program for storing data into database by reading sql statements from text file

  • How can I order a custom size photo from iphoto?

    Hi, I have three frames that I want to order photos for from iphoto.  The custom size is 5 x 5 which is no problem selecting from within iPhoto, but when it comes time to actually place the "order", there is no option to select a 5 x 5 size.  Can any

  • Sub Column to be displayed in ALV

    Hi All,   The requirement is to display an ALV report with sub columns under a column.   Can anyone guide me on how to display the sub columns under a particular column using ALV?   Appreciate your help. Thanks and Regards Krunal Raichura

  • FORM PRINTING

    Hello All I am trying to print label through Smartform using Tharo printer fallowed using a EASY lABEL software pbl is that in accordance to software the file should be trasfeered to Html format after generation from Smart forms so kindly suggest the

  • Jdev10.1.3: Create an UIX XML Page; Problem: No UIX-Item available...

    hello, i am new to jdev. at the moment i'm trying to complete the tutorial "Developing Applications with Oracle ADF UIX". (http://www.oracle.com/technology/obe/obe9051jdev/uixTutorial/lesson_UIX.htm) my problem: i followed the instructions until i wa