showing reports created in an applet

B

bucky.pope

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?
 
D

Dave Miller

bucky.pope 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.

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?
 
R

Roedy Green

A

Andrew Thompson

On Jun 28, 5:27 am, Roedy Green <[email protected]>
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>
 
M

Mark Space

bucky.pope 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.

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/>
 
B

bucky.pope

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?

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.
 
B

bucky.pope

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.
 
B

bucky.pope

On Jun 28, 5:27 am, Roedy Green <[email protected]>
wrote:
...


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>

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?
 
A

Andrew Thompson

...
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.
 
M

Mark Space

bucky.pope said:
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?
 
A

Abhijat Vatsyayan

bucky.pope 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.

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top