Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

not getting list

 
Swapna latha
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai i am having the doubt on getters and setters.

I have Messages.java as follows:



I have UserLoginServiceImpl.java



I am not getting the list of items in service implementation class. I think theres a problem in getter in Message. java


Thanks & Regards
Swapna
 
Manoj Kumar Jain
Ranch Hand
Posts: 198
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post only code that is required and running, there is lot of commented code that makes reading hard.
Also please mention the line no where the output is expected and what you are getting..
 
Manoj Kumar Jain
Ranch Hand
Posts: 198
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many times I experienced that eclipse doesn't work with getter/setter when we create them manually.
Its better to delete your getter/setter and create them again with Eclipse.
 
Swapna latha
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Messages.java



This Messages.java is working fine

UserLoginServiceImpl.java



In service implementation class i am unable to get the list from getMessages of Messages.java. I am getting the size as zero. I want to get the list from Messages.java to ServiceImpl class.

Why i am not getting the list ?

Thanks & Regards
Swapna
 
Manoj Kumar Jain
Ranch Hand
Posts: 198
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


If you are talking about this code snap ? I can't see anywhere you initialized the value of messages ArrayList. If you haven't add any value to this list then how this can return you something.
 
Swapna latha
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ya i am not understanding manoj exactly. help me please.
 
Manoj Kumar Jain
Ranch Hand
Posts: 198
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your problem is that you are not getting data from the list..right ?
So, Just check in your code where you are filling that list..where are you adding data in that list..
 
Swapna latha
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ya i am adding the list values in Messages.java. I want to retrieve the values in service class from the method getMessages()

Regards
Swapna
 
Manoj Kumar Jain
Ranch Hand
Posts: 198
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swapna latha wrote:ya i am adding the list values in Messages.java. I want to retrieve the values in service class from the method getMessages()

Hey I am confused here, am I missing something?
In the line 67 you are creating a new object of Messages class
that's correct but where you have add the values in that messges object for the list ? I cant see anything in the constructor as well.
 
Swapna latha
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Manoj Kumar Jain wrote:
Swapna latha wrote:ya i am adding the list values in Messages.java. I want to retrieve the values in service class from the method getMessages()

Hey I am confused here, am I missing something?
In the line 67 you are creating a new object of Messages class
that's correct but where you have add the values in that messges object for the list ? I cant see anything in the constructor as well.


I have resolved the issue. Any Thanks for sparing time

Regards
Swapna
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic