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

unable to pass data in same package

 
tushar panda
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mybean.jsp :


mybean servlet :


how can i get myname value as "cikun" in line 17 in mybean servlet . i have changed the value of myname in doGet service method.
i tried by putting this function "setTitle(myname)" in doGet but it didn't solved the problem .
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm really not sure what you're trying to do.

Are you trying to pass data from a servlet to a JSP? Are you trying to create a JavaBean and for some reason extending a servlet?
 
tushar panda
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:I'm really not sure what you're trying to do.

Are you trying to pass data from a servlet to a JSP? Are you trying to create a JavaBean and for some reason extending a servlet?

sorry for late reply

i am supposed to get the value "cikun" in the mybean.jsp page so for this i need to set the value in "setTitle()" method , so how can i get the value of "myname" which i have changed as "cikun" in doGet.i hope i have explained right this time
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
container instantiates servlet. you cant
 
tushar panda
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
seetharaman venkatasamy wrote:container instantiates servlet. you cant


can't get it.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tushar panda wrote:



jsp:useBean is designed for a JavaBean. not for a Servlet.[i did not check that jsp:useBean with servlet.but i think it wont make sense]
 
tushar panda
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually i am setting a value of a variable in the doGet method , so using beans i was trying to pass the value to the jsp page .
i should be shot for trying to merge beans & servlet , ok trying now .
thanks for pointing the mistake
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you are welcome
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic