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

Model is not working?

 
Soumya Rout
Ranch Hand
Posts: 49
Java Java ME Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

I have a servlet from that two values given by the are passed to the model class set method.

But when try to retrieve those values in another servlet its not coming .

And i have imported the model class in both the servlets.

Help me

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
imports are meaningless at run time. Are you passing the same instance around?
 
Soumya Rout
Ranch Hand
Posts: 49
Java Java ME Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nop im not .

Im creating different instaces.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basic Java: values set in one instance will not be automatically available in another. What are you doing to set the values into the new instance?
 
samir singha
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
creating diffrent instances means you are creating diffrent objects. create a single object, set the value of the object and pass the object to the another servlet.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic