• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Comparing two vectors in a jsp

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hashtable's containsValue(Object value) method should give you some hints.
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's nothing JSP-specific about this so I've moved it to the Java in General(intermediate) forum.
 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Try 100 things. 2 will work out, but you will never know in advance which 2. This tiny ad might be one:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic