runtime.exec in Linux

Discussion in 'Java' started by K McNeil, Jun 15, 2004.

  1. K McNeil

    K McNeil Guest

    Is there a way to launch an Excel spreadsheet from a jsp page on a Linux server?

    In windows it's
    runtime.exec(new String[] { "rundll32", "url.dll,FileProtocolHandler",
    C:\excelDirectory\excelFile.xlt} );
     
    K McNeil, Jun 15, 2004
    #1
    1. Advertising

  2. On 15 Jun 2004 08:21:02 -0700, K McNeil wrote:

    > Is there a way to launch an Excel spreadsheet from a jsp page on a Linux server?


    Probably not by multi-posting your question
    all over the place..
    <http://www.physci.org/codes/javafaq.jsp#xpost>

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology
     
    Andrew Thompson, Jun 15, 2004
    #2
    1. Advertising

  3. K McNeil wrote:
    > Is there a way to launch an Excel spreadsheet from a jsp page on a Linux server?
    >
    > In windows it's
    > runtime.exec(new String[] { "rundll32", "url.dll,FileProtocolHandler",
    > C:\excelDirectory\excelFile.xlt} );


    Presumably you at least need to put some additional quotes into that and
    make sure to initialize variable "runtime" to something sensible.

    To answer your question: it depends. The Java code in your JSP runs on
    the server, not the client, so you cannot use it to do anything directly
    on the client. What you can (try) to do is to make your JSP or servlet
    create a response which will prompt the client to do what you want.

    If the spreadsheet lives on the server then the answer is probably to
    just send the the raw spreadsheet data as the response entity, with the
    appropriate MIME type (look it up) and perhaps some shenanigans with
    naming. This job is more appropriate for a pure servlet than for a JSP.
    Do note that in this scenario, any changes the user makes to the sheet
    will not be reflected on the server.

    If the spreadsheet lives on the client or is to be accessed on the
    client via a network share, then you need some kind of code that will
    run on the client. That typically takes the form of JavaScript, which
    you would include in an HTML response from your JSP. I'm afraid I can't
    help with the JavaScript details, but very likely one of the free
    JavaScript repositories has just what you would need.


    John Bollinger
     
    John C. Bollinger, Jun 15, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. wex
    Replies:
    18
    Views:
    20,605
    gbendotti
    Oct 18, 2010
  2. Hal Vaughan
    Replies:
    11
    Views:
    1,195
    Gordon Beaton
    May 22, 2006
  3. tedsuzman
    Replies:
    2
    Views:
    7,162
    Michel Claveau, résurectionné d'outre-bombe inform
    Jul 21, 2004
  4. Ted
    Replies:
    1
    Views:
    493
    Duncan Booth
    Jul 22, 2004
  5. Replies:
    4
    Views:
    24,319
    vivek_kothari
    Jan 12, 2010
Loading...

Share This Page