This content has been marked as final.
Show 1 reply
-
1. Re: Securing POJO Web Service
parmarsanjay Oct 10, 2006 4:29 AM (in response to parmarsanjay)I found the way to do this. I had to implement "ServiceLifecycle" interface for my Web Service and provide implementation for init and destroy method.
private ServletEndpointContext mServletEndpointContext = null;
private ServletContext mServletContext = null;
public void init(Object context)
{
System.out.println("Init Called");
mServletEndpointContext = (ServletEndpointContext) context;
mServletContext = mServletEndpointContext.getServletContext();
}
/**
*
*/
public void destroy()
{
System.out.println("Destroy Called");
mServletEndpointContext = null;
mServletContext = null;
}
You can get the user prinicipal from ServletEndpointContext .
Cheers,
Sanjay