Win a copy of Pragmatic AI this week in the Artificial Intelligence forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

return value from java method to servlet  RSS feed

 
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
 
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?
 
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
 
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!