• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

return value from java method to servlet

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks everyone i got the answer.
 
reply
    Bookmark Topic Watch Topic
  • New Topic