A Solution? (and of course a question for better ones)


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: A Solution? (and of course a question for better ones)

Hybrid View

  1. #1
    Graste Guest

    A Solution? (and of course a question for better ones)


    Thanks, folks.

    Probably I will use an applet to start word with a file that I created on
    the server (using a servlet). The restriction of applets will not be a (too)
    big problem, because it's an intranet-based system I'm working on.
    Any idea how I can tell the applet the name of the file I created on the
    server? I thought of something like:
    1. create the word template (html, using xml/xsl), give it an unique name
    (with session-ids?) and save it to disk
    2. generate a html-output in the browser with a call to the applet (path/filename
    in <params>)
    3. open word (Runtime.getRuntime().exec("cmd.exe /C somefile.doc") (runs
    on NT systems with office installed ;-)

    ANY better ideas are welcome...these are only my first thoughts

    Regards

    Graste

    BTW: Sorry for my bad english. ;-)


  2. #2
    epna Guest

    Re: A Solution? (and of course a question for better ones)


    Hello Graste,

    You can use java serialization to pass any kind of objects between a servlet
    and an applet.

    To do that, the applet uses an URLConnection to connect with the servlet,
    and get an ObjectInputStream associated to the URLConnection.
    The servlet can get a ObjectOutputStream from the HttpServletResponse object.
    Then the servlet must serialize an object (using writeObject) and the applet
    can deserialize the object (using readObject).

    This system allows you to pass any type of object (as complexes as you want)
    between the servlet and the applet.

    For detailed information don't doubt to email me.

    Good luck.

    "Graste" <graste@gmx.de> wrote:
    >
    >Thanks, folks.
    >
    >Probably I will use an applet to start word with a file that I created on
    >the server (using a servlet). The restriction of applets will not be a (too)
    >big problem, because it's an intranet-based system I'm working on.
    >Any idea how I can tell the applet the name of the file I created on the
    >server? I thought of something like:
    >1. create the word template (html, using xml/xsl), give it an unique name
    >(with session-ids?) and save it to disk
    >2. generate a html-output in the browser with a call to the applet (path/filename
    >in <params>)
    >3. open word (Runtime.getRuntime().exec("cmd.exe /C somefile.doc") (runs
    >on NT systems with office installed ;-)
    >
    >ANY better ideas are welcome...these are only my first thoughts
    >
    >Regards
    >
    >Graste
    >
    >BTW: Sorry for my bad english. ;-)
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center