[jboss-user] [JBossWS] - Re: Securing POJO Web Service

parmarsanjay do-not-reply at jboss.com
Tue Oct 10 04:29:37 EDT 2006


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

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977150#3977150

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977150



More information about the jboss-user mailing list