Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
    Bookmark Topic Watch Topic
  • New Topic

writing the user defined function in servlet

 
srinivasan tkvsn
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Report post to moderator
hai;

i am writing a servlet using doGet(). In this doGet() method can i
write a user dfined which will be calling another ...based on some condition.
could any body show me the way please..
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Report post to moderator
A servlet is a regular Java class. It can contain other methods besides the ones defined in the Servlet interface, and those methods can be called from doGet/doPost. Does that answer your question?
[ July 17, 2006: Message edited by: Ulf Dittmer ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Originally posted by srinivasan tkvsn:
hai;

... In this doGet() method can i
write a user dfined


You can not nest methods in Java (without going through some contortions).
You can write your own methods can call them from the doGet method.
 
shilpa deshmukh-kadam
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Report post to moderator
Ben Souther wrote:


You can not nest methods in Java (without going through some contortions).
You can write your own methods can call them from the doGet method.


I get errors while creating my own method and I want to call my own method into anather servlet can you help me please my code is as below


Thank you
 
Palak Mathur
Ranch Hand
Posts: 342
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
@shilpa This is 10 year old thread. Please take care while posting your questions. I am sure that you would not like to wake the zombies. I also did the same mistake when I posted my first question here and I am still waiting for the reply. Hope you will not like to happen the same with you. Start a new thread.
 
    Bookmark Topic Watch Topic
  • New Topic