can an applet call one of the methods of servlet?

hi everyone...

i m very new servlet and applet programming and i have come accross a problem....

i m using a applet which establishes connection with the servlet(residing on server)..i want to use few of the methods of the servlet....

now is it possible tfor me to call the methods of this servlet using its object.?

please help me..

thanx in advance

[387 byte] By [Mr.VijayDesai@OPSPLa] at [2007-11-27 11:54:47]
# 1

It certainly can.

You can use java.net.URL to invoke HTTP GET requests.

You can use Apache Commons HttpClient PostMethod API to invoke HTTP POST requests.

BalusCa at 2007-7-29 18:58:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

first of all thanx a lot for the reply...

but i wanted to know can an applet call any other function of servlet other than get and post....as i hacve defined some more functions in servlet..

please reply...

Mr.VijayDesai@OPSPLa at 2007-7-29 18:58:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Are you talking about utility methods? Don't write that in servlets. Refactor them to utility classes and add them to the classpath of the applet.

BalusCa at 2007-7-29 18:58:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

> first of all thanx a lot for the reply...

>

> but i wanted to know can an applet call any other

> function of servlet other than get and post....as i

> hacve defined some more functions in servlet..

>

> please reply...

I did this a while back (2003/4?) and unless it's changed you cannot do it directly, it must be GETor POST, then you could just use conditional logic to invoke another method.

yorkroada at 2007-7-29 18:58:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

but i am using these methods to establish database connectio and insert update and delete data...for each one of these functionality i have made seperate function...

i have to use servlet for databse connection as applet connection to databse is not reccomende.d..

an u suggest me of something...

Mr.VijayDesai@OPSPLa at 2007-7-29 18:58:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...