I have a bunch of shell scripts on every client machine. I need a web interface to provide settings for these scripts and it should invoke these scripts.
If i run a web application from a server to run scripts, it will overload the server due to multiple client requests, so client side web app is preferred.
Applets can solve this. But, it is outdated and I dont like it.
Is there any other new/good technologies to do such client side computing ?
Are you talking about web application or desktop application?
If this is a web application, so as far as I know - no. You must use applet embedded at your web page to run the script.
If desktop application - it can use the API for execution processes at Java.
Another option is maybe to download some small server code that will be used to invoke scripts, and have you web application communicate with it, in order to invoke a process.
The downside of this is that this is not a "straightforward" usage of your web application.
Related
I want to create a simple strict service that tells the client if a PDF file is searchable or scanned images (not OCRed). Then I thought that the code is very simple and could run very fast, but the heavy lifting is in uploading the file especially if the file is large. Is there a way in Java and Spring to execute the code on the client's machine (if the client has JVM) by sending the code to the client to be executed and get the result?
Are you looking for Java Web Start?
https://www.java.com/en/download/faq/java_webstart.xml
The Java Web Start software allows you to download and run Java
applications from the web. The Java Web Start software:
Provides an easy, one-click activation of applications
Guarantees that you are always running the latest version of the application
Eliminates complicated installation or upgrade procedures
A signed Web Start application can request permissions to access local resources, native libraries and hardware.
To send the result back to server, you can simply have the Web Start application send it via HTTP[S]. The JNLP used to launch the Web Start application can be dynamically generated, so you can set parameters for the Web Start application, to have it send the parameter back to server, so you can identify which user session it is.
I have a Java application that needs to run the proprietary software PowerWorld on the server and then return output to the client side Web Start window. Is this possible? How do I go about doing this?
I am using Apache Tomcat to run the server. My Java code uses Runtime.exec() to run a Python script that runs PowerWorld. I made sure that the python script, powerworld file and java app are all in the same directory and reference each other using relative file paths
Java WebStart will install a desktop application into the cache of the client. That will run on the client not on the server, however you can easily create a webapplication as a service, i.e. on Tomcat. The webapp will be able to receive client requests, i.e. via RMI, RESTfull service or webservice, call the proprietary programm and return the results.
I already have an Java application running on client site.
This application currently does not have any UI. What it does is just transforming data for the client behind the scene.
We need to regularly upgrade the application.
Now we would like to add a UI using GWT.
My question is
Can I include GWT directly into my current application, as a whole?
I mean, my current Java application start from main(). On client side, we just execute java Application (simply say). After we have our GWT part, we really want everything still the same. On client side, we don't need to let client or we ourselves install many new things.
So ideally, after we finish our GWT part, for client, still, our application is one application and the way to launch is only java Application
We don't want to tell client that we need a TomCat server to be seperately installed.
We don't want client feel troublesome and it seems now we need to maintain multiple packages, etc.
You need a web-server to serve you GWT application, orelse it can not communicate with local Java app. As you run GWT-compiled Javascript in a browser, it can't access to your local machine resources.
It can be a Tomcat running on localHost or you could use Google App Engine. You can't run a GWT app like a Java Swing application.
But relax... Tomcat is not that troublesome and does not require more package that what is already in it.
I have an existing Java application running on a linux box that monitors the state of relays and network information. This is a stand-alone device currently.
What I would like to further develop is a web server for the device to remotely monitor, configure, and control the device via an Ethernet connection. To achieve this, I need some way to interface between the web server, which could be configured as enabled/disabled, and the master device, which is always running.
Is there a good way to do this? I have looked at apache w/ tomcat and similar web servers but not sure if this is what I need. The key here is that the web server needs to be able to access the existing java application without interfering with its always running services.
You either develop a webapp, use your Java application's API inside the webapp, and deploy this webapp inside a web container. Or you can do the reverse and embed a web server inside your application (see here for documentation to embed Jetty).
If you want to keep the webapp and the original application in two separate JVMs, you'll need some wey to communicate between both, like sockets, RMI, or even files, but it will be more complex.
You might want to take a look at JMX http://docs.oracle.com/javase/tutorial/jmx/overview/index.html
I want to run a standalone java application on a remote server. It would not be accessible to clients, but would do background calculations and interact with a database and Secure Socket connection to a third party site. It would also interact with a php site.
Do I have to deploy this with JSP, or can I write a standalone application? If so, how would I deploy a standalone java application (jar file) on a remote server? I understand that I must have them install a jvm on the server (not a problem) but then how would I deploy it (if possible). Would I start it with a command line?
I know I have much to learn, but I am not sure how I would access the command line on a remote server. Through the cPanel?
Thanks.
First of all, you'll want to set up some firewall rules to allow access to that server. I'm hoping that you don't expose that server naked to the Internet.
If all you need is database access exposed on the Internet, I don't see why it can't be a secured web app deployed on a servlet/JSP engine and accessed via a web server. You can leverage basic auth for security, JDBC access to the database from the server, and servlets as controllers to accept requests in a nice REST API.
It'll save you the complications of sockets and inventing your own protocol (use HTTP), starting and stopping the application (now it's just a web server/servlet engine), and deployment (send a WAR file).
Does it really must be a 'standalone' application? I think that in your case the best match would be to use Spring container to load your application within some server (tomcat?) and expose services via standard controllers - with Spring you only have to add some annotations on services methods actually.
Then, your php site can interact with these controllers using for example ajax requests.
If your application is written already, you can easily transform it to run within Spring container. It's very non-invasive and promotes usage of POJOs.