Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

return value from java method to servlet

 
Deepak Chawla
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a java class where i am using 1 method to insert values in database , after that insertion, i want to return something from that method to servlet and that servlet should display that information is added.
i can get the information display but i don't know what to return and how that retun value will work in that servlet.
plz help
 
Sim Raina
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
u mean that u have a method and a servlet is calling that method and whatever the method is returning , u don' know what that is?
is that what u are asking?
 
Sri Basavanahally
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure what the "big picture" here is, in other words may be there is a better way to do what you are doing. But, in general a servlet responds only to a client request on the web.
Is this a web application ?
-Sri
 
Brian R. Wainwright
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I understand you correctly, you want a message to display in the user interface that says something like, "Update completed successfully" after the update has ocurred. So you have your servlet that calls a method that updates the database and returns the success or failure of the update to the servlet (or that's what you want to happen). More info is really neccessary about the structure of your application to be able to provide you with a really thorough response. Are you using JSP's or is your servlet writing HTML out to the client? Is the databse update code in the servlet itself?
--BW
 
Deepak Chawla
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks everyone i got the answer.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic