• Post Reply Bookmark Topic Watch Topic
  • New Topic

adding a user defined function to servlet

 
Dev Kulkarni
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys,

i have wrote a servlet to enter some details into database. at the same time i want to use those values in a user defined function. can i write a method in the servlet itself ? is it the right way to go ? i will post code i have written along with function i want to call.

Code:
 
Anurag Verma
Ranch Hand
Posts: 168
Hibernate Spring Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to CodeRanch Dev,
Yes, you can add your methods in the servlet class. breaking your code into methods is always recommended for having a clean code. In this particular scenario, applying few design patterns will make your code even better.
 
Dev Kulkarni
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anurag Verma wrote:Welcome to CodeRanch Dev,
Yes, you can add your methods in the servlet class. breaking your code into methods is always recommended for having a clean code. In this particular scenario, applying few design patterns will make your code even better.


Dev Kulkarni wrote:Thanks Anurag..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!