Re: Java Applet pulled from VMS Web Server



Hi Neil,

At the end of the day, any flavour of Java solution (application, applet,
or
servlet) all need to run on a JVM (Java Virtual Machine) and you'll never
convince me that this is somehow better than native apps.

I agree 100% I recommend native apps to everyone and don't want them to be
restricted by the browser sandbox and its idiosyncrasies. But I am also
pragmatic, lacking in conviction on the issue, and a purveyor of VMS server
software that doesn't care less what talks to it :-)

I say "Use the Internet more and the browser less!". But the browser is
everywhere. You don't have to load/maintain/release *any* client software!
Sounds good to me - And, more to the point, good to the people with the
purse-strings!

At the end of the day, any flavour of Java solution (application, applet,
or
servlet)
:
1) A Java servlet runs on a JVM at the web server

I don't want to sound like Foghorn Leghorn, but my beak's a flappin' and you
don't seem to be a listenin'! I'm not saying you're "as sharp as a bowlin'
ball" but let me spell it out for everyone: - 1) I couldn't give a toss what
JVM or JDK is on VMS or what contortions one may have to perform to get
anything to work and 2) I will go to my grave before deploying a "Java
servlet" on a VMS system as I just don't see the point!

What's more (and if you'd've read my ITRC posts you'd already know) I'd like
to use FTP (as opposed to HTTP) as the protocol to upload the .JAR applet
file from VMS, 'cos that way I wouldn't have to run with the baggage of a
Web-Server on VMS at all! I also floated the possibility of compiling and
archiving your applets on a Unix or Windows system and then just copying
your .JAR files to your VMS server to be upload to the PC browser clients.
Net result: - *NO* JVM and *NO* JDK on your VMS box - Just
Application-Server grunt and reliability!!!

Might not be for everyone, but if it proves to be technically feasible then
it sure works for me.

But let's not scare everyone off - you can still use INETd or home-grown if
you prefer.

My employer purchased two copies of the book and we used the author's
warnings to put the brakes on a couple of projects inside our company.

Like Arne, I'd like to know what those warnings were too please.

Cheers Richard Maher

PS. Below is an example from Brian Reiter over at the ITRC thread. I hope it
helps somebody 'cos I simply can't do this. I have brought you to water
(Yeah, real quality H2O Himilayan shit Steve :-) but I simply cannot make
you drink :-( All you (someone) have to do is join up the bloody dots!

If you find a stumbling block then I'll chase it down for you; otherwise get
off your arses and do something!

Unfortunately, if anyone from HP works it out, then they'll just send up
some European proposal to put ten layers of concealing crud on it to keep
their mates employed for the next 10 years :-(

Now, I have taught you how to fish. The next Wanker that say he's hungry
get's it :-)

public class CobWebDisplay extends Applet implements Runnable {

private volatile Thread displayThread = null;
private SubsState subs[] ;
private SubsState subs[] ;

private String host ;

StatusStore store = new StatusStore() ;

tcpthread reader ;

Image cobweb_logo ;
Image serco_logo ;

int portid;

public void init() {



String portstring = getParameter("portnumber");
if ( portstring == null)
{
System.out.println("Missing parameter -portstring- in APPLET
tag");
}
else
{
portid = Integer.parseInt (portstring) ;
}

System.out.println ("Port "+portstring);
serco_logo = getPicImage("serco_logo.gif");
cobweb_logo = getPicImage("cobweb.gif");

URL urlServer = getCodeBase();

host = urlServer.getHost() ;

store.updatestore ( "COBS 0 ") ;

store.updatestore ( "LCC 2 -1 -1") ;
store.updatestore ( "LCC 3 -1 -1") ;
store.updatestore ( "LCC 4 -1 -1") ;
store.updatestore ( "LCC 5 -1 -1") ;
store.updatestore ( "HAL -1 -1") ;

store.updatestore ( "IPL 1 -1 -1") ;
store.updatestore ( "IPL 2 -1 -1") ;



repaint();

}



public void update (Graphics g) {

paint( g) ;
}

public void paint(Graphics g) {

store.paint( g) ;



g.drawImage(serco_logo, 0 ,0, this);
g.drawImage(cobweb_logo, 0 ,50, this);

}


private Image getPicImage(String imageFileName) {


Image imgWork = null;
MediaTracker mt = new MediaTracker(this);

try
{
imgWork = getImage(getDocumentBase(),imageFileName);
}
catch(Exception e1)
{
System.out.println(e1);
}
mt.addImage(imgWork, 0);
try
{
showStatus("Loading image " + imageFileName );
mt.checkID(0, true);
mt.waitForID(0);
}
catch(Exception e2)
{
System.out.println(e2);
}
return imgWork;
}


public void start() {
if (displayThread == null) {


reader = new tcpthread ( store , host , portid) ;
reader.start() ;

displayThread = new Thread(this, "Display");
displayThread.start();


}
}

public void run() {

int i = 0;


Thread myThread = Thread.currentThread();
while (displayThread == myThread) {


repaint();



try {
Thread.sleep(1000);
} catch (InterruptedException e){ }
}
}


}






class COBSConnection {

Socket Sckt;
String Host = null;
DataOutputStream Out;
BufferedReader In;
String host ;
int port ;

COBSConnection(String h, int p) {

host = h ;
port = p ;
}

void connect () {
try {




Sckt = new Socket(host,port);
Out = new DataOutputStream(Sckt.getOutputStream());
In = new BufferedReader(new
InputStreamReader(Sckt.getInputStream()));
if (Sckt.isConnected()) {



}

else {
System.out.println("Not Connected to " + Host);


}
}
catch (Exception e) { }
}

void close() {
try {
Sckt.close();
}
catch (Exception e) { }
}

void send(String S) {
S = S+"\n";
try {
Out.writeBytes(S);
}
catch (Exception e) { }
}

String recv() {
String S;
try {
while ((S=In.readLine())==null);
return S;
}
catch (Exception e) {
return null;
}
}
}


class tcpthread extends Thread {

StatusStore store ;
COBSConnection cobs = null;
boolean connected ;

String host ;
int port ;

tcpthread ( StatusStore s , String h , int p ) {
store=s ;
host = h ;
port = p ;
}



public void init () {


System.out.println("Host name is " + host);

cobs = new COBSConnection( host,port ) ;

cobs.connect();



}

public void run () {



init() ;

connected = true ;


store.updatestore ( "COBS 1 ") ;

while (true) {

while (connected)
{
String S;

S = cobs.recv() ;

if (S!=null)
{
store.updatestore(S) ;

}
else
{
connected = false ;
}
}

cobs.connect() ;

connected = true ;
}

// cobs.close() ;

}

// public void stop() {cobs.close(); }

}


"Neil Rieck" <n.rieck@xxxxxxxxxxxx> wrote in message
news:45453db6$0$7476$9a6e19ea@xxxxxxxxxxxxxxxxxxxxxxx

"Richard Maher" <maher_rj@xxxxxxxxxxxxxxxxxx> wrote in message
news:ei3ah1$5kj$1@xxxxxxxxxxxxxxxxxxxxxxxxx
Hi Neil,

[...snip...]

It is my understanding that it is a common and secure practice to have
your
browser settings organized to let unsigned applets run in the sandbox
and
connect back to the server that they were downloaded from. Are you
saying
this is not the case? (Having said that my IE on Windows2000 server
seems
to
show Allow "All" network connections or "None". Does the registry have
to
be
modified to get finer granularity or am I looking in the wrong place?
Anyone
with other browsers care to share their Java-setting experiences?)

As far as Applets not being able to do "much" I've had some very useful
exchanges with people doing extremely interesting things with Java! For
example, using my Mickey Mouse employee surname lookup from the
mf_personnel
database people have described to me how they are using AJAX to monitor
the
input field and for every keystroke send the updated contents back to
the
server for a new list of matching employee surnames and display it as a
drop-down as the user is typing in. Similar to what Google does with
search
strings if you know what I mean.

Now, because no one seems to speak english in the Unix, Java, New world,
I
have additional questions such as: - Is the "Asynch" part in AJAX
different
to the other sperate "threaded" examples people have shown me? Are any
reduce security settings required for AJAX as opposed to other
Javascript?
Is it available everywhere normal Javascript is available?


I pretty much agree with all your points. A few years back I got "sucked
in"
by all the Java hype and ended up taking a few semesters of Java training
at
a local college. Like off shoring, many companies want programmers to
check
out Java solutions because they programs are mostly cross platform and
cheap
(or even free).

At the end of the day, any flavour of Java solution (application, applet,
or
servlet) all need to run on a JVM (Java Virtual Machine) and you'll never
convince me that this is somehow better than native apps.

So hopefully these answers will clear up some of the mystery (but I'm no
expert; just a johnny-come-lately)

0) A java application runs on a local JVM (I guess this is obvious)

1) A Java servlet runs on a JVM at the web server

2) A Java applet runs on a JVM at the client end (after being sent by the
server)

3) There are some cool Java applets out there which can communicate with
servlets

4) Like any C/C++ program, a properly written Java applet can use TCPIP to
open a connection to a remote database. Because Java has been used to do
all
kinds of evil things, I find the default environment for most JVMs is very
restricted. (but users are allowed to remove most of these restrictions)

5) Like LAMP, AJAX is a very cool collection of technologies (Asynchronous
Javascript And XML) used together to pull off some desired task. I have
never heard of AJAX using JAVA, just Javascript (the two technologies are
completely different). The Asynch phrase relates to the ability to have an
asynchronous communications channel working behind the scene in your
browser, watching what you do, and possibly offering choices to you while
you type, and before you click submit. For a good AJAX demo just surf on
over to http://maps.google.com Notice how the page never reloads when you
submit data? I have found a lot of good AJAX articles are linked to the
bottom of this page: http://en.wikipedia.org/wiki/AJAX as well as here:

http://www-128.ibm.com/developerworks/views/web/libraryview.jsp?search_by=Mastering+Ajax&ca=dgr-wikiaMasterAJAX

6) if you want to experience a real Java reality check, read Roland Hughes
book titled "The Minimum You Need To Know About Java about Java on
OpenVMS".
You can read a small review of the book here:

http://www3.sympatico.ca/n.rieck/links/cool_openvms.html#TMYNTK-About-Java-on-OpenVMS
My employer purchased two copies of the book and we used the author's
warnings to put the brakes on a couple of projects inside our company.

I hope you find this information useful.

Neil Rieck
Kitchener/Waterloo/Cambridge,
Ontario, Canada.
http://www3.sympatico.ca/n.rieck/links/cool_openvms.html


.



Relevant Pages

  • Mouse Wheel Events Go Missing Once Embedded Onto a Web-page??
    ... A very simple java applet that catches and processes all mouse ... Could this be a java bug or am i missing something very obvious?! ... public void actionPerformed ... repaint(); e.consume;} ...
    (comp.lang.java.help)
  • Re: Error Exception in thread "main"
    ... As new in Java, I had read an introduction and now I like to run it in Linux. ... [gastonv@telenetPC Java-beginners]$ javac jhello.java ... public void paint { ... An Applet is not an application and cannot be run with the 'java' command. ...
    (comp.lang.java.help)
  • Re: detecting which jvm version is being ran?
    ... information about the Java version: ... The applet is unsigned and it works without security messages in any ... public void paint{ ... I don't know what browser their using nor do I know the ...
    (comp.lang.java.programmer)
  • Re: Simple java test
    ... I tried the applet in chapter two of _Java and JavaScript Programming_ ... public void MyTurn{ ...
    (comp.lang.java.programmer)
  • using generated java code in Java applets
    ... I'm using Matlab Java Builder to compile .m ... When I run teh applet in netbeans environmnet, ... public void init() { ...
    (comp.lang.java.programmer)