I am building an intranet application with GWT, gilead and Hibernate, and Tomcat.
As I am actively calibrating the application based on the users' feedback, I have to put on changes and restart tomcat quite often. I was wondering how I can seemlessly make these changes available to the client side. (For the moment I always ask them to refresh after I restart tomcat).
Since the application is client-side (js) based, the client has the application code. Imagine the scenario where he has the application open, and I upload a new version and restart. After the restart, the user can perfectly go on using the application as he has the page open, but he is executing the old code. How can I make the client aware of the new code? I guess just invalidating the session and redirecting the user to the login page won't do that, as the js code won't be refreshed.
Any ideas?
As you mention the application will continue to work after the server side update. Even calls to the new version on the server might work if the interface was not changed.
A possible solution is to have a comet connection open, for example with Atmosphere for GWT. At any time when you have deployed a new version you broadcast an event to the active clients. Clients applications will receive this broadcast and act on it, prompting the user to refresh. You could also use this mechanism to pass messages to active clients, like upcoming server maintenance times.
Related
I'm working with GWT's Logging mechanism to show:
Client logging output in client's Browser (using com.google.gwt.logging.client.HasWidgetsLogHandler)
Client logging output in server log (com.google.gwt.logging.server.RemoteLoggingServiceImpl)
Server logging output in server log (using java.util.logging.*)
Is it reasonable and possible to show server log in a client debug component?
Would you advise to send server logging to client instead of using an extra "tool" to access the server log? Which can be a comfortable realization for detached server logging?
In the server-side, you can use any tool you like, obviously... in the client-side, GWT provides all these wonderful options you mentioned, including the RemoteLogger which lets you log stuff going on in the client-side in the server (which is not something you would want to do in production, but for debugging may be helpful).
It's hard to understand why you would need logs to go the other way, ie. from server to client..... maybe you don't have access to the server?? But then how are you going to work on the GWT code, which lives in the server??? Just doesn't add up... if you have access to client logging (be it hosted-mode GWT.log("") messages, production mode java.util.logging, or even the Remote logger), and you have your server logs, you have the whole picture already!
In my opinion, the answer to your question:
Is it reasonable and possible to show server log in a client debug component?
is simple:
No, it is not reasonable.
However, if you really must, do it using GWT's RPC mechanism which allows you to send almost anything at all to the client (within the GWT limits, of course), including log messages....
I have a perl web application (CGI::Application with ModPerl::Registry) which connects to a authenticated custom server over a socket and exchanges data (command/response) with it. Currently the web application connects to the server, authenticates and disconnects on every page request - even for the same user.
Is there some way I can use the same socket over multiple page requests which share a common session id? Creating a separate daemon that proxies connections and makes them persistent is an option I am exploring, but would like to know if there are any simpler solutions.
I have no control over the design of the custom server unfortunately.
Looks like the same question was asked on PerlMonks. The responses there point in the right direction, but the issue seems to be that you want one cached connection per session, not one cached connection per session per httpd thread/process. You might have to resort to a separate proxy process to get the behaviour you want.
How do they do this? I would like to have web pages with data fields that change in real time as a person views the web page. Here is an example.
How do they do this? JQuery? PHP?
I need to connect my field data to mySQL database.
There are two approaches:
Polling
Client requests data on a regular basis. Uses network and server resources even when there is no data. Data is not quite 'live'. Extremely easy to implement, but not scalable.
Push
Server sends data to the client, so client can simply wait for it to arrive instead of checking regularly.
This can be achieved with a socket connection (since you are talking about web pages, this doesn't really apply unless you are using Flash, since support for sockets in the browser in the browser is currently immature) - or by using the technique known as 'comet'.
Neither socket connections nor comet are particularly scalable if the server end is implemented naively.
- To do live data on a large scale (without buying a boat load of hardware) you will need server software that does not use a thread for each client.
I did it with JavaScript timer set execution in milliseconds, each time timer executed function that queried Server with Ajax and returned value(possibly JSON format), then you you update your field with the value. I did it each 5 sec and it works perfectly. In ASP.NET I think it called Ajax Timer Control.
There are two things needed to do this:
Code that runs on the browser to fetch the latest data. This could be Javascript or something running in a plugin such as Silverlight or Flash. This will need to periodically request updated content from the server.
Which leads to a need for...
Code that runs on the server to retrieve and return the latest data (from the database). This could be created with any server sided scripting language.
I am builing a win application that has user access control against a sql db, all the data is stored in this db as well.
This project is to be installed in one site on 30-40 machines (I mean to say that it's not web, it's all in one place, maximum call it intranet).
I want that while the program is logged on, the logged-in user should be able to chat to the other logged in users.
Any recommended approaches in C# & VB?
I would appreciate any idea, link or tip.
Please share me with your experience
Thanks!
NOTE: The program is in Wpf if it does matter.
Architecturally, it seems like a publisher-subscriber message bus would be a good pattern for you. You would have a centralized server that each client would register with that will distribute notifications from publishers to subscribers.
Each client will register for notification of the client list upon starting. Each client can register interest in being notified when another client publishes a message. Each client would publish messages to the bus to be delivered to any subscribers for that client.
There is a good example of a pub-sub message bus written in WCF in MSDN: WCF ESSENTIALS What You Need To Know About One-Way Calls, Callbacks, And Events. You could get this up and running fairly quickly.
I need to implement a process where users punch in a few details into a web page, and have this information fired as some
sort of an event to a Java rich client application (SWING) on the same host.
One idea was perhaps implementing an applet that would initiate socket communication with a listener implemented by the SWING
application, but not sure whether this is possible at all.
This sort of puzzling piece of integration is basically a given fact.
Essentially both the web application and the SWING one are already active and in use.
The only missing bit is sharing info between the two, in a way that would be easy to implement. no matter how dirty.
Any ideas?
Thanks!
Sounds a little confusing to the user if nothing else.
I would go one of two ways.
Have your rich client communicate over the network. And put whatever form you were going to have in the browser there.
Put your rich client into an applet.
Have both connect to a server somewhere (even locally), which your rich client can poll to see if the form has been filled in.