cancel
Showing results for 
Search instead for 
Did you mean: 

How to call a servlet in a session bean

Former Member
0 Kudos

Hi

I have one servlet.

I have one session bean.I created a webservice for the

session bean.

My Requirement is to call that servlet from the session

bean which will be used to create a webservice.

Kindly suggest me.

Bye

SomaRaju

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

Plz check with this i think this will help you to solve your problem.

Actually it is not advisable to call an servlet from a session bean .

I mean you can not create an object of servlet from session bean .

In otherway it can be possible if your session bean can call this through an protocol.

means you can create an URL or URL connection class and call it through http protocol.

i .e we can create URLConnetion ( HttpURLConnection ) object to that servlet from a session bean

Thanks

Mrutyunjaya Tripathy

former_member182372
Active Contributor
0 Kudos

Hi SomaRaju,

You can do this using java core URL class http://java.sun.com/j2se/1.4.2/docs/api/java/net/URL.html

or

HttpClient library from Apache (more powerfull)

http://jakarta.apache.org/commons/httpclient/

Best regards, Maksim Rashchynski.