Showing results for 
Search instead for 
Did you mean: 

How to call a servlet in a session bean

Former Member
0 Kudos


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.



Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos


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


Mrutyunjaya Tripathy

Active Contributor
0 Kudos

Hi SomaRaju,

You can do this using java core URL class


HttpClient library from Apache (more powerfull)

Best regards, Maksim Rashchynski.