Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Comparing two vectors in a jsp

 
Pravin Jagan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hashtable's containsValue(Object value) method should give you some hints.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65114
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's nothing JSP-specific about this so I've moved it to the Java in General(intermediate) forum.
 
Chengwei Lee
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doh! I need to learn to read questions properly. Cheers for clearing up my mistake Chengwei Lee.
 
Chengwei Lee
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doh! I need to learn to read questions properly. Cheers for clearing up my mistake Chengwei Lee.


No problem Paul
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic