Is it possible for a Java desktop application to interact with Java Servlets or Java EE Applications?
Yes it is definitely possible, take a look at Web Services. Here is another link with a simpler explanation.
You can also use EJBs (stateful or stateless). Installing an EJB client on your desktop app will take care of most of the communication details for you. And you always have the option of communicating via pure RMI. Both options would typically be more efficient than a SOAP or REST based solution. Good options if you don't need to worry about creating a non-java version of your desktop app.
Related
I need to build a desktop application for internal users for certain business. It also needs web based GUI for external users. I know, with web GUI both internal and external users can access it, but there are certain factors which are outside our control - due to which, desktop application is really unavoidable. For the purpose of this question, I would like to focus on the way to support both Desktop client (Swing) and Browser client.
Are there any best practices to be followed? I could think of below:
Expose service classes as web services and use these from both Swing client and web client
Expose service classes as EJB (business is into Java EE techs) and use Swing client as EJB client. Web client can use controller classes to interact with EJB
Are there any known benefits of using either approach, apart from technology agnosticism offered by web services?
Also, for swing client, I am thinking of using Java Web Start for easy distribution. I have never used it before, but from what I understood, it can support automatic version check at startup and update the client when required - is this correct?
If you need to avoid dependency to Java/JVM on the browser (which you most likely at least want to), you should definitely go with mixed Swing-Vaadin approach. Build the internal application with Swing or JavaFX and web part with Vaadin. The programming model in Vaadin is so close to typical desktop UI library that it is really easy for the same developers to work with both code base, and naturally you'll use exactly the same backend.
See the example application I recently built to demonstrate a setup like this.
I recently created an internal website for my company that launches client side applications. This website is suppose to be the central place from which users will launch all their business applciations. The reason it is a website is because is somewhat difficult to deploy applications to client workstations in our compnay due to packaging requirements, and also we want to make our client thin clients as much as possible. To achieve this what I have currently done is writen a website that laucnhes a ClickOnce application with some arguments passed to it via url. The argument basically provides the command for Process.Start.
As our company is primarily .net I chose ClickOnce however I also know that java webstart can do the same thing. Infact to me it seems to launch a bit faster as well.
Can anyone please provide some pros and cons between ClickOnce and Java webstart?
They are very similar and specular technologies...I think Microsoft has thought to JavaWebStart for ClickOnce tech. But you cannot compare them because ClickOnce is for .NET world while JavaWebStart is only for Java World.
So if your work is primarily based onto .NET, why do you have to evaluate JavaWebStart?
P.S. you know that you can use ClickOnce and JavaWebStart directly from a network share, I suppose...
I am a novice to web application programming trying to build first webapp and read that Node.js can be used for high-performance, highly concurrent and suited for web applications.
My question is that is it possible to hook up Node.js with Java backend?
How does that work?
Thanks
To start off with node.js is a backend. So if you have a misconception of what node.js then you don't need Java.
If you want to integrated node.js into an existing Java application to use it as a real time communication platform then you can get the two talking to each other over TCP sockets.
Take a look at the net docs
I am new to Java web. Can anyone recommend some useful and efficient web framework to create UI and develop the code using Java? I am a core Java developer.
UPDATED
Thank you for your guidance guys i am planning to go with GWT ..and once again Thankyou...
Java Web Frameworks might not help you in designing UI, in real sense. You might need to look at JavaScript frameworks for that, i.e. YUI, jQuery, Scriptaculous, extJS etc..
However, Wicket and Stripes, are good among Java Web Frameworks for rapid development. Found a related thread about mostly used Java Web Frameworks.
You may use GWT ( http://code.google.com/webtoolkit/ ). This will allow you to create most of your UI using Java only.
Vaadin (www.vaadin.com) may be one to try.
You can use Adobe Flex (licensed) and integrate it with Java. It provides rich UI toolkit.
I would also recommend GWT. Not only for client side possibilities, but also for integration in IDE - Eclipse plugin, Netbeans plugin (GWT4NB), client-server capabilities with RPC helps to use a lot of already done work (java libraries) on server side.
Integration with Tomcat or another servlet container is of course also the main funcionality.
Why should there be problems with deploying GWT in Tomcat?
I have a java server with a BlazeDS interface to handle Adobe AIR clients. I also have a bunch of legacy stand alone java apps that I'll need to integrate with the server. The java apps need all the same methods and remote calls that the AIR clients needs. So it would save tons of work if I could call the remote object methods from the java apps.
Anyone know if this can be done?
You can use the BlazeDS Java AMF libraries directly over HTTP. But interacting with the BlazeDS MessageBrokerServlet will require some extra work. Probably an easier path is to just expose the same Java services through another protocol that the Java code can more easily use.
Take a look on this library, it allows you to connect Java with a server running BlazeDS. On the other hand if you are interested in pure performance you can investigate another protocols..there are plenty of them.