{
InitialContext ctx = new InitialContext();
StatelessSessionLocalHome home = null;
Context enc = (Context) ctx.lookup("java:comp/env");
home = (StatelessSessionLocalHome) enc.lookup("ejb/local/SecuredEJB");
StatelessSessionLocal bean = home.create();
if( method.equals("echo") )
bean.echo("UnsecureEJBServlet called SecuredEJB.echo");
else if( method.equals("unchecked") )
bean.unchecked();
else if( method.equals("checkRunAs") )
bean.checkRunAs();
else
throw new IllegalArgumentException("method must be one of: echo, unchecked, checkRunAs");
}
catch(Exception e)
{