• Post Reply Bookmark Topic Watch Topic
  • New Topic

is applet what I'm looking for?  RSS feed

 
Aftab Hassan
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have a .java file which has been built into a .class file, and now I want this to be called on the click of a button on the HTML page. Is 'applet' the answer to this ? I searched around this question on the internet prior to posting but every applet tutorial I see is related to graphics and drawing blocks etc.

Please note that my java file does not have any graphics, it's just a simple stand-alone code which opens a file and displays it's contents on the terminal. Would like to now see the output on the browser.

Please advise.
Thanks.
 
Roger Sterling
Ranch Hand
Posts: 426
Eclipse IDE Fedora Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Welcome to the Ranch.

You may like to work through these tutorials (HTML5 especially). http://www.w3schools.com/html/default.asp


The solution is a bit more complex than you are anticipating, I'm afraid.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Applets generally aren't the answer any more these days. Let's take a step back and tell us what the underlying problem is you're trying to solve. Java code generating output for a browser is generally part of a server-side web app.
 
Balagopal Kannampallil
Ranch Hand
Posts: 136
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aftab,

As Ulf pointed out, you should not be thinking in the direction of Applets these days.

You can consider jsp/servlet combination as an option.
 
Aftab Hassan
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Applets generally aren't the answer any more these days. Let's take a step back and tell us what the underlying problem is you're trying to solve. Java code generating output for a browser is generally part of a server-side web app.

Ulf, thanks for the reply.
The underlying problem :
1. The html page has a text field where you can input some text.
2. This text is then transferred to a php script which parses the text and finds the important words(removes unnecessary words like articles/prepositions)
This is in php and has to be kept that way because I have this php script which I wouldn't like to rewrite right now
I would like to call something like php5 myscript.php
Had it been say C, I would have called system("php5 myscript.php");
3. Finally these important words generated from the php script are transferred to a Java program which matches them with a pool of words and tries to find synonyms of these words.

So, basically something like Language Processing.

Is there a way I can accomplish this in a short time. I will definitely learn JSP/servlets in the days to come but I'm not sure I'll be able to finish this quickly in JSP/servlets right now

Balagopal Kannampallil wrote:Aftab,
As Ulf pointed out, you should not be thinking in the direction of Applets these days.
You can consider jsp/servlet combination as an option.

Thanks for the reply Balagopal.
Yes, I shall put in my effort to learn JSP and Servlets, that' something I really want to learn. Thanks for the direction.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Too bad you want to keep that PHP script, otherwise I would have suggested Java and the Lucene library, which can do all kinds of nifty things with language processing, including synonyms.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!