• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Urgent Help Needed.

 
Ajit Malleri
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
The following is a brief description of what I have to implement:
The idea of this application is to track the users on the site and send the details to the swing application. There's a piece of javascript code in the webpage which sends the details to the servlet in certain time interval. In the servlet the details are stored in a hashtable. Details are stored in a bean which is in turn stored inside the hashtable. The detail also include the total time on page. The servlet needs to send this detail to the swing application. Now the problem is how should I send the detail to the swing application? The swing-servlet communication is through sockets. I am thinking of sending the hashtable to the swing application where I will de-serialize the information and built it on the client side. But what about the scenario when I have plenty of information to send? It will consume a lot of resources and will be very slow. How should I solve this problem?
Thanks,
Ajit
 
gautham kasinath
Ranch Hand
Posts: 583
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there is a specific file for IIS, check that out.
That is the one that will solve your problem in an easy by M$ way.
But for that, you will need to have a strong logic for session tracking/profiling the user.
I have done that for a desktop application, I will think of a way for the Web and let you know.
Regds
Lupo
 
Ajit Malleri
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks buddy .. will wait for your answer.
 
gautham kasinath
Ranch Hand
Posts: 583
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I m sorry Ajit, I havent been able to think in those lines for a wile now. I guess I will spend my weekend on the issue.
Lupo
 
Karthik Banda
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ajith,
Its a wonderful problem most of we guys are facing. What i suggest is go with Asynchronous messaging using JMS. Your servlet will publish the details to a destination and from there ur swing application will subscribe it and gets the details as a message. I cant excatly spare some time...other wise i would have given u atleast a skeleton..But dont forget that there needed a session locatior or identifier whose information it is and i suggest u go with using StingBuffer or String with a few Delimiters written as a message from the servlet.
Last which company are u working for and where?
What sort of product it is....
mail me in person at karthik78in@yahoo.com
Regards,
karthik
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ajit Malleri:
[...] The servlet needs to send this detail to the swing application. Now the problem is how should I send the detail to the swing application? The swing-servlet communication is through sockets.
Why?
Personally, I'd subscribe to the XP mantra of doing the same thing that possibly works. With a servlet in a servlet container, you already have a perfectly fine, lightweight, well-supported network infrastructure. Why not have the servlet -- or a different servlet in the same web-app -- serve up the required information? The Swing application could simply request/poll as required.
I am thinking of sending the hashtable to the swing application where I will de-serialize the information and built it on the client side.
You can do that; have a magic HTTP request (protected using container security if need be) that serves up serialized Java objects. If you want a more portable and flexible approach you could return an XML file or even use XML-RPC or SOAP.
But what about the scenario when I have plenty of information to send? It will consume a lot of resources and will be very slow. How should I solve this problem?
That depends on the information. You might be able to just send what's new.
A completely different approach would be to use a SQL database, ranging from a lightweight embeddedhsqldb database through MySQL to Oracle. The servlet would stuff its raw information into the database. The Swing application would query this database; I assume it wants to digest the raw results in some way, and digesting large amounts of information is something databases were designed to do.
If firewalls are an issue, you can still tunnel this over HTTP.
- Peter
[ January 17, 2003: Message edited by: Peter den Haan ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic