Open files with java program

D

David

Hi all,

This is probably very easy but in the brief looks i have had so far I
have not yet found the answer.

I am writing a program for internal use within the company i work for.
However, I want to create links from a web page to pass information
into the program.

I was thinking click on a hyperlink.myprogextension

which the user clicks open and a command is passed to the program or
another program which loads and connects to a port, and passes the
info in the file to the main program.

The program is always running so actually opening a file should just
toggle it to do certain actions with the data passed.

Is there an obviously solution to keep it simple? or would the open
with another program and pass via a network link be the best method,
as there is only 1 running instance of the main program?

Also how do you associate links in the java programming language in
windows, to enforce the loading of a file to an assigned java program?

Hope the above makes sense, any ideas to keep it as simple as possible
would be great or just pointers would also be really appreciated.

Many thanks in advance

David
 
A

Andrew Thompson

David wrote:
...
This is probably very easy but in the brief looks i have had so far I
have not yet found the answer.

This may not be the final answer, but the webstart based
SingleInstanceService* provides *most* of the functionality
that you mention. The only part I have not seen tested, is
that the SIS is more attuned to dealing with files that are
coming off the local file system - I am not sure how it would
react to files handed to it direct from the internet.

You might want to download the build file and set up a
test. I would be interested to hear your results.

* E.G. <http://www.physci.org/jws/#sis>

--
Andrew Thompson
http://www.physci.org/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-general/200801/1
 
I

Ivan Novick

Hi all,

This is probably very easy but in the brief looks i have had so far I
have not yet found the answer.

I am writing a program for internal use within the company i work for.
However, I want to create links from a web page to pass information
into the program.

Assuming you want to use all Java, then how about having a servlet on
your web server, activated by your link, and in the servelet use RMI
to communicate to the running process.

There are many many ways to do this ...

Regards,
Ivan Novick
http://www.0x4849.net
 
R

Roedy Green

I am writing a program for internal use within the company i work for.
However, I want to create links from a web page to pass information
into the program.

Usually you write a servlet. Web pages send GET-POST requests using
HTML forms.

You could write an Applet. It runs on the client. It can accept
keystrokes, and send data to a server.

You could write a JAWS app. It runs on the client. It can accept
keystrokes, and send data to a server. It runs independently of the
browser, thought he browser can launch it.

If you hate yourself, you would collect the data in JavaScript and
pass it through to an Applet.
 
Joined
Jan 11, 2008
Messages
2
Reaction score
0
Hi to all members.
I want to extract Text from a file. For example I have a file named index.html
LIKE

<html>
<head>
<script language="JavaScript" type="text/javascript">
function window_onload()
{

var numberForms = document.forms.length;
var formIndex;
for (formIndex = 0; formIndex < numberForms; formIndex++)
{
alert(document.forms[formIndex].name);
}
}
</script>
</head>
<body language=JavaScript type="text/javascript" onload="window_onload()">

<form name="form1">
<p>This is inside form1</p>
</form>
<form name="form2">
<p>This is inside form2</p>
</form>
<form name="form3">
<p>This is inside form3</p>
</form>
</body>
</html>

I want to parse this file in this way that in the output file no Javascript code be displyed. It will removes the javascript starting and ending tags and the javascript code in that tags will not be displayed. And this file will be looked like this

<html>
<head>
</head>
<body>
<form name="form1">
<p>This is inside form1</p>
</form>
<form name="form2">
<p>This is inside form2</p>
</form>
<form name="form3">
<p>This is inside form3</p>
</form>
</body>
</html>

plz help me out and sorry for my english.
 
D

David

Usually you write a servlet. Web pages send GET-POST requests using
HTML forms.

You could write an Applet. It runs on the client. It can accept
keystrokes, and send data to a server.

You could write a JAWS app. It runs on the client. It can accept
keystrokes, and send data to a server. It runs independently of the
browser, thought he browser can launch it.

If you hate yourself, you would collect the data in JavaScript and
pass it through to an Applet.

Hi all,

Thanks for the ideas, I will look into the RMI idea. Just to clarify
the program is actually already written using java as a standalone
app. It communicates with servers on other machines, so clicking on a
link has to pass information into a locally running process. Looking
at the replies I think RMI looks like the best candidate, before I'll
have to learn RMI and setup a server to run servlets to communicate
with a running process, any other ideas just in case there is a nice
simpler method?

Thanks for all the above help, really appreciated thanks.
 
R

Roedy Green

I am writing a program for internal use within the company i work for.
However, I want to create links from a web page to pass information
into the program.

If you click something in a browser there are basically two ways you
can capture that:

1. an Applet. The applet can then send a message to some other app on
the same machine or on a server, or do the work itself.

2. hit submit in a form which sends a message to a server which then
hands the message to a Servlet for processing.

See http://mindprod.com/jgloss/applet.html
http://mindprod.com/jgloss/servlet.html
 

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,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top