
Can a user defined function be included in a servlet? I need information regarding servlet syntax and not JSP.

Yes, you can create user defined function in Servlets.
Have a look at the following link:
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.