I am making a servlet program. It is working fine, but now I am trying to make a method other than doGet or doPost that get called from JSP. Is it possible?
+1
A:
No, it is not. If you want to have a single servlet which controls all requests and can invoke business actions depending on the request, then have a look at the front controller pattern.
If you actually want to invoke utility methods (public static
methods in a public final
class) during display, then you can make use of EL functions (something like as JSTL functions).
BalusC
2010-04-07 12:12:42
(+1) (well, actually you do access the `service(..)` method :) )
Bozho
2010-04-07 13:05:00
Or `doPut()`, `doTrace()`, etc.. But that's likely not what he's after :)
BalusC
2010-04-07 13:11:11
I want use my own methodName is it possible ? w/o using any framework...
saloni
2010-04-08 03:56:50
Then homegrow a framework with a front controller which does that. JSF for example is open source, check there how they did it.
BalusC
2010-04-08 11:18:52