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

Can't see the data of the vector in the Action

 
AnilPrakash Raju
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I got a couple of entities in a entity that is added to a vector. I can display th data on the jsp but when i press submit and check for the values in the action, it shows the entities are null

eg.
<nested:iterate id="shiftAllocation" type="vo.ShiftAllocation" property="shiftAllocationVec" name="shiftAllocationSearchForm">
<tr class="trClass">
<td class="tdClass"><nested:write name="shiftAllocation" property="vrDuty.dutyName"/> </td>
<td class="tdClass"><nested:text name="shiftAllocation" property="misShiftAlloc.shiftAllocation" styleClass="textLargeClass" /> </td>
</tr>
</nested:iterate>

in my ActionFrom i got a get() and set() for shiftAllocationVec.

When i look at the data for shiftAllocationVec, it shows that it has 6 shiftAllocation Entities( which is the no. of rows i am displaying).
But when i look inside this entity, the values are null.

A shiftAllocation Entity consists of a vrDuty entity and a misShiftAlloc entity.


What am doing wrong?

Thanks

Anil
 
sreenath reddy
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Actually u might have set the from bean before coming to jsp in some action .As soon as u come to that jsp u r displaying that ..........but after submitting this page if the scope of the form bean is request then that vector wont be avialble for u .

so u need to set the scope if u want it to be avialable across different requests.

i hope this is what u r trying for sreenathn@huawei.com
 
AnilPrakash Raju
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Sreenath,

But making the scope "session" based does not help. I can see the vector and it contains the no. of rows that was displayed. But it does not contain the values of the entities that was displayed. For example misShiftAlloc = null in this case

Thanks

Anil
 
sreenath reddy
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

There is no way that this can happen and i feel u r having a vector of objects ....and that each object having set and get methods . As long as the scope of the form bean is not lost there is no way that objects canm be lost untill unless u r explicitly setting them to null by any chance check it out ........
 
AnilPrakash Raju
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sreenath,

Actually in that object - it consists of two other objects. So when the submit is hit, it seems it cannot determine where to put the values.

Thanks

Anil
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic