aspose file tools*
The moose likes Java in General and the fly likes Comparing two vectors in a jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Comparing two vectors in a jsp" Watch "Comparing two vectors in a jsp" New topic
Author

Comparing two vectors in a jsp

Pravin Jagan
Greenhorn

Joined: Feb 28, 2005
Posts: 27
hi,
Im working on a module of a network application installer system(which helps to deploy applications over a network)..So idea is basically.. like this..
i get a view of systems on the network on my homepage n when i do a right click it should pop up a window showing the list of applications available on the server and their latest version and the list of application on the systems and their latest version. So it would have display like this



so what i need to do here is to colour the row which has difference in versions.(say.. the first row in the above example)
so far i have come up with two hastables each containing an application id(unique one) the latest version available on the server and the client.
So the hashtable looks some thing like this..

so can anyone guide me on how to do comparison n give the desired output on to the jsp
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Hashtable's containsValue(Object value) method should give you some hints.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61198
    
  66

There's nothing JSP-specific about this so I've moved it to the Java in General(intermediate) forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Chengwei Lee
Ranch Hand

Joined: Apr 02, 2004
Posts: 884
Hashtable's containsValue(Object value) method should give you some hints.


containsValue merely tells you if the object exists in the Hashtable. It doesn't link you to any specific application-id. Meaning to say, it doesn't tells you which key it belonged to.

I suppose 2 Hashtables are available, 1 to hold the the application-id & deployed version while the other holds application-id & latest version.

I'd recommend two methods, containsKey & get instead. Its safer not to assume that both Hashtables contains the equal number of entries.

HTH


SCJP 1.4 * SCWCD 1.4 * SCBCD 1.3 * SCJA 1.0 * TOGAF 8
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Doh! I need to learn to read questions properly. Cheers for clearing up my mistake Chengwei Lee.
Chengwei Lee
Ranch Hand

Joined: Apr 02, 2004
Posts: 884
Doh! I need to learn to read questions properly. Cheers for clearing up my mistake Chengwei Lee.


No problem Paul
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Comparing two vectors in a jsp