I obviously have very little understanding of your actual project/problem ... so i'm going to assume some things in my response but maybe what you need to do is provide a getter in your student object like getQualificationName which takes the qualification code and returns the mapped value. My understanding is that this student object has some codes which in turn you have mapped to display values which you are keeping in a map.
This should solve the problem if I'm understanding correctly ...
posted 8 years ago
I am using struts2 + hibernate for the current project ...
I cannot just put a getter / setter / object in my Student class because this in turn will be mapped with the database <Hibernate used here>
I have a List<Student> which will contain student's details. this is student's table.
Qualfication code is mapped with a qualification name .. i.e 1->BE , 2->ME etc... This is a seperate table ...
Using struts tags , this will work when iterating each and every record in the studentList .
My StudentAction class contains getters for qualificationMap
Now when i am using displaytags , i iterate over the studentList, but when i come to qualification_code
This will give me only the integer part for each and every student ... This values keeps on changing for each and every student.
So i cannot just set one value.
But i want to display the mapped name from qualficationMap which is inside my StudentAction class.
So i tried combining different things like the qualificationMap[qualification_code] but it does not work.
Hope that you'll be able to understand the problem.
If i just know how to get the dynamic value in the display tag and get the mapped value from the Map, this will defenitely solve the problem.
posted 8 years ago
After spending lots and lots of hours on this , finally got the solution ..