showing reports created in an applet

Discussion in 'Java' started by bucky.pope, Jun 27, 2008.

  1. bucky.pope

    bucky.pope Guest

    I want to build a report in a String in an applet then display that
    string in a browser window without writing a file to disk.

    Any suggestions?
    bucky.pope, Jun 27, 2008
    #1
    1. Advertising

  2. bucky.pope

    Mark Rafn Guest

    In article <>,
    bucky.pope <> wrote:
    >I want to build a report in a String in an applet then display that
    >string in a browser window without writing a file to disk.
    >
    >Any suggestions?
    Mark Rafn, Jun 27, 2008
    #2
    1. Advertising

  3. bucky.pope

    Dave Miller Guest

    bucky.pope wrote:
    > I want to build a report in a String in an applet then display that
    > string in a browser window without writing a file to disk.
    >
    > Any suggestions?

    The applet is running in the same browser window? If yes, why wouldn't
    you display the report within the applet / where exactly within the
    window do you want to display the report?

    --
    Dave Miller
    Java Web Hosting at:
    http://www.cheap-jsp-hosting.com/
    Dave Miller, Jun 27, 2008
    #3
  4. bucky.pope

    Roedy Green Guest

    On Fri, 27 Jun 2008 09:32:55 -0700 (PDT), "bucky.pope"
    <> wrote, quoted or indirectly quoted someone who
    said :

    >I want to build a report in a String in an applet then display that
    >string in a browser window without writing a file to disk.


    You might just throw the whole thing in a JTextArea with a scroller.
    see http://mindprod.com/jgloss/jtextarea.html

    A bit more complex, use a JTable if you want columns or editing. see
    http://mindprod.com/jgloss/jtable.html

    If you want to write it to disk you must sign the app or write as a
    JWS app.
    see http://mindprod.com/jgloss/javawebstart.html
    --

    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
    Roedy Green, Jun 27, 2008
    #4
  5. On Jun 28, 5:27 am, Roedy Green <>
    wrote:
    ....
    > If you want to write it to disk you must sign the app or write as a
    > JWS app.
    > see http://mindprod.com/jgloss/javawebstart.html


    That's a good page, but I don't see any reference to some
    recent developments that involve hooking applets into webstart
    services (and making them draggable). This allows an unsigned
    applet, embedded in a web page, to access the local disks
    using the JNLP API (and also to be dragged off the web page -
    thereby installing them locally).

    This was only introduced into the 1.6.0_10 (beta, when I
    last saw it) JRE, but it does seem interesting (interesting
    enough for me to download the _10-beta update to play with
    it).

    JNLP support:
    <https://jdk6.dev.java.net/plugin2/jnlp/>
    Draggable applet:
    <https://jdk6.dev.java.net/plugin2/#EXPERIMENTAL_FUNCTIONALITY>

    --
    Andrew Thompson
    http://pscode.org/
    Andrew Thompson, Jun 28, 2008
    #5
  6. bucky.pope

    Mark Space Guest

    bucky.pope wrote:
    > I want to build a report in a String in an applet then display that
    > string in a browser window without writing a file to disk.
    >
    > Any suggestions?


    You probably mean scriptlet, not applet. The two are very different too.

    Scriptlets are for web programming and for web apps, and use Java EE (I
    think that's what they're calling it these days). Applets are much
    older tech that never really caught on, and are not used much any more.


    http://java.sun.com/javaee/

    <http://www.javapassion.com/j2ee/>

    <http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/>
    Mark Space, Jun 28, 2008
    #6
  7. bucky.pope

    bucky.pope Guest

    On Jun 27, 12:53 pm, Dave Miller <> wrote:
    > bucky.pope wrote:
    > > I want to build a report in a String in an applet then display that
    > > string in a browser window without writing a file to disk.

    >
    > > Any suggestions?

    >
    > The applet is running in the same browser window? If yes, why wouldn't
    > you display the report within the applet / where exactly within the
    > window do you want to display the report?
    >
    > --
    > Dave Miller
    > Java Web Hosting at:http://www.cheap-jsp-hosting.com/


    This is an app that might run from a local web page or from a remotely
    loaded web page. I figured by displaying the report in the browser,
    the user would have all his or her regular browser capabilities: save,
    print, email or they might want to keep several reports open in tabs.
    That would save me a lot of programming.
    bucky.pope, Jun 28, 2008
    #7
  8. bucky.pope

    bucky.pope Guest

    On Jun 28, 1:33 pm, Mark Space <> wrote:
    > bucky.pope wrote:
    > > I want to build a report in a String in an applet then display that
    > > string in a browser window without writing a file to disk.

    >
    > > Any suggestions?

    >
    > You probably mean scriptlet, not applet.  The two are very different too.
    >
    > Scriptlets are for web programming and for web apps, and use Java EE (I
    > think that's what they're calling it these days).  Applets are much
    > older tech that never really caught on, and are not used much any more.
    >
    > http://java.sun.com/javaee/
    >
    > <http://www.javapassion.com/j2ee/>
    >
    > <http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/>


    I may deploy this app either from a hosted webpage for a local copy of
    the same page loaded from a distribution cd. I thought EE was server
    only. I'm looking for the simplist solution possible.
    bucky.pope, Jun 28, 2008
    #8
  9. bucky.pope

    bucky.pope Guest

    On Jun 28, 1:38 am, Andrew Thompson <> wrote:
    > On Jun 28, 5:27 am, Roedy Green <>
    > wrote:
    > ...
    >
    > > If you want to write it to disk you must sign the app or write as a
    > > JWS app.
    > > seehttp://mindprod.com/jgloss/javawebstart.html

    >
    > That's a good page, but I don't see any reference to some
    > recent developments that involve hooking applets into webstart
    > services (and making them draggable).  This allows an unsigned
    > applet, embedded in a web page, to access the local disks
    > using the JNLP API (and also to be dragged off the web page -
    > thereby installing them locally).
    >
    > This was only introduced into the 1.6.0_10 (beta, when I
    > last saw it) JRE, but it does seem interesting (interesting
    > enough for me to download the _10-beta update to play with
    > it).
    >
    > JNLP support:
    > <https://jdk6.dev.java.net/plugin2/jnlp/>
    > Draggable applet:
    > <https://jdk6.dev.java.net/plugin2/#EXPERIMENTAL_FUNCTIONALITY>
    >
    > --
    > Andrew Thompsonhttp://pscode.org/


    JNLP has a showDocument like AppletContext, but it also requires a
    URL. Is there any way to create a URL that points to a String in
    memory instead of a file or a web page?
    bucky.pope, Jun 28, 2008
    #9
  10. On Jun 29, 7:00 am, "bucky.pope" <> wrote:
    ...
    > > JNLP support:

    ...
    > JNLP has a showDocument like AppletContext, but it also requires a
    > URL. Is there any way to create a URL that points to a String in
    > memory instead of a file or a web page?


    Short answer no, long anwser, nope.

    But if the applet wraps the report up as the
    *parameters* for an URL, a JS* on the receiving
    web page could write out the report in a form
    suitable for the browser to render it, and the user
    to print it. There will be numerous problems
    trying to 'save' such a report though.

    I think your best (least effort) option is to
    sign the applet, as Roedy suggested, then write
    a temporary file containing the report. If your
    users want these reports, they should be willing
    to accept a trusted applet (especially if you
    explain why the extended trust is required).

    I saw a great applet that asked at start-up if
    you wanted to trust it, initially I said no, so
    it went ahead to prepare the visually interesting
    parts of the applet, but had things like the 'Print'
    and 'Save' buttons disabled - 'These are available
    in the trusted version'.

    * Noting that you are not running an active
    server in some cases.

    --
    Andrew Thompson
    http://pscode.org/
    Andrew Thompson, Jun 29, 2008
    #10
  11. bucky.pope

    Mark Space Guest

    bucky.pope wrote:

    > This is an app that might run from a local web page or from a remotely
    > loaded web page. I figured by displaying the report in the browser,
    > the user would have all his or her regular browser capabilities: save,
    > print, email or they might want to keep several reports open in tabs.
    > That would save me a lot of programming.


    OK, I see where you are going. I don't know enough about applets to
    tell if they are a good idea in this instance. You might have to write a
    quick-and-dirty version of you code to find out if an applet is going to
    work for you.

    Curious: what do these "reports" that you load into Strings look like?
    Just ASCII text with no formatting? Something more complicated?
    Mark Space, Jun 29, 2008
    #11
  12. bucky.pope wrote:
    > I want to build a report in a String in an applet then display that
    > string in a browser window without writing a file to disk.
    >
    > Any suggestions?

    I have never used this but you might want to look at it:
    http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/java_js.html

    Alternatively, if you want to write your code in Java and if your code
    can live within the constraints imposed by GWT (google web toolkit), you
    might consider using it(GWT). You probably will not be able to use GWT
    if you have a large codebase and/or are using third party libraries
    (mostly because these libraries will use code which can not be compiled
    by the GWT compiler). GWT will let you write code in Java but it
    integrates with browsers very nicely - it has a compiler/translator for
    converting java code to javascript which you can embed in a HTML page.
    Abhijat Vatsyayan, Jun 29, 2008
    #12
    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. Brian Barnes
    Replies:
    1
    Views:
    572
    J Jones
    Feb 18, 2004
  2. Peri
    Replies:
    1
    Views:
    2,950
    =?Utf-8?B?Um90aGFyaWdlcg==?=
    Jul 21, 2005
  3. Replies:
    2
    Views:
    863
  4. Rod
    Replies:
    2
    Views:
    1,777
  5. Replies:
    0
    Views:
    472
Loading...

Share This Page