last day (14 days later) » 

10:12 AM
1
Q: Join two Map on Jsp page - Struts2 application

V.RohanI am working on Struts2 Application; my displaying objects are Map objects: Map<String, HashMap<String, List<PlanDAO>>> channelRoomTypePlanmap = new HashMap<String,HashMap<String,List<PlanDAO>>>(); Map<String, List<RateInventoryDAO>> rateInventoryMap = ...

 
... which is showing in wrong format, means showing all data from second Map in single row for all. - But that is what you are doing. Put rows inside iterator if you want so.
 
@RomanC actually i done with combination key, now i want row from 'rateInventoryMap = new HashMap<String, List<RateInventoryDAO>>();' based on that key on jsp page. Can i generate that key jsp page, and find that key in 'rateInventoryMap'?
@AleksandrM i done with <s:iterator> but where i can check for key, and print corresponding list
@RomanC next time ll keep in my mind
 
Don't check for key, just use it to retrieve value from the map.
 
@AleksandrM m attaching view above, where m getting all map values in one row.
 
Use rateInventoryMap['your_key_here'].currentRate.
 
10:12 AM
@AleksandrM i this this ll helpful, but how can i combine above values(above iterator values) to generate Key?
 
So what is your key? What do you mean by generate a key?
 
i want to use Key+Value from 'channelRoomTypePlanmap' to check it with Key from 'rateInventoryMap' ,if true then and then only print the next .
and how can do this in jsp ?
 
but your value of channelRoomTypePlanmap is a hashmap
can you show a key for rateInventoryMap map?
 
its Key like ABCD_Standard_MAPS in rateInventoryMap
i want to generate this key for searching it in rateInventoryMap.
 
10:29 AM
why do you use such ugly structures? why not to create object that holds all values that you need? or if you really like maps then why not to use map inside Map<String, HashMap<String, List<PlanDAO>>> instead of list?
 
And this is where we totally agree :D
 
java is Object Oriented Programming language so create and use Objects.
 
10:45 AM
@AleksandrM Map inside Map ?
its ll take time for iteration ? lengthy ?
Actually m totally new for Struts, that's why ,its look like Scrappy. :) .
if i want to get this kind of View then which ll be preferable way ?
Can i generate HTML at class and then pass it to JSP ?
 
do you know how to generate html for that table in java class?
like I said create an object that will hold all values that you need an then in jsp just use it
you already use map inside map ... so if you don't want to change that ... put another map inside map inside map...
 
Map<String, HashMap<String,HashMap<String,List<Rate>>>>> like ?
its teasing myself. is it feasible ?
if in future its going to more difficult to maintain ,then i ll do it in HTML
 
11:45 AM
You should handle more meaningful objects in java side, from dao to service / business layer. Please read the first link in the answer...
 

last day (14 days later) »