public void init( FilterConfig filterConfig ) throws ServletException { ActionContext context = ActionContext.getContext(); container = (PlexusContainer) context.getApplication().get( PlexusLifecycleListener.KEY ); try { LoggerManager loggerManager = (LoggerManager) container.lookup( LoggerManager.ROLE ); logger = loggerManager.getLoggerForComponent( this.getClass().getName() ); } catch ( ComponentLookupException e ) { throw new ServletException( "Unable to lookup Logger from plexus.", e ); } }
protected boolean condition() throws JspTagException { ActionContext context = ActionContext.getContext(); PlexusContainer container = (PlexusContainer) context.getApplication().get( PlexusLifecycleListener.KEY ); try { UserManager config = (UserManager) container.lookup( UserManager.ROLE, "configurable" ); return !config.isReadOnly(); } catch ( ComponentLookupException cle ) { throw new JspTagException( "unable to locate security system", cle ); } } }
protected boolean condition() throws JspTagException { ActionContext context = ActionContext.getContext(); PlexusContainer container = (PlexusContainer) context.getApplication().get( PlexusLifecycleListener.KEY ); try { UserManager config = (UserManager) container.lookup( UserManager.ROLE, "configurable" ); return config.isReadOnly(); } catch ( ComponentLookupException cle ) { throw new JspTagException( "unable to locate security system", cle ); } } }
if ( context.getApplication() == null ) PlexusContainer container = (PlexusContainer) context.getApplication().get( PlexusLifecycleListener.KEY );
protected synchronized ActionInvocationTracker addActionInvocation( ActionInvocation invocation ) throws ComponentLookupException { Map sessionMap = invocation.getInvocationContext().getSession(); ActionInvocationTracker tracker = (ActionInvocationTracker) sessionMap.get( ActionInvocationTracker.ROLE ); if ( tracker == null ) { ActionContext actionContext = invocation.getInvocationContext(); PlexusContainer container = (PlexusContainer) actionContext.getApplication().get( PlexusLifecycleListener.KEY ); //noinspection deprecation tracker = (ActionInvocationTracker) container.lookup( ActionInvocationTracker.ROLE, getTrackerName() ); sessionMap.put( ActionInvocationTracker.ROLE, tracker ); } tracker.addActionInvocation( invocation ); return tracker; } }
PlexusContainer container = (PlexusContainer) context.getApplication().get( PlexusLifecycleListener.KEY ); SecuritySession securitySession = (SecuritySession) context.getSession().get( SecuritySystemConstants.SECURITY_SESSION_KEY );
PlexusContainer container = (PlexusContainer) context.getApplication().get( PlexusLifecycleListener.KEY );
public void beforeResult(ActionInvocation invocation, String resultCode) { String key = getKey(invocation); Map app = ActionContext.getContext().getApplication(); final OgnlValueStack stack = ActionContext.getContext().getValueStack();
.getApplication().get( PlexusLifecycleListener.KEY ); plexusContainer.release( action ); if ( this.getLogger().isDebugEnabled() )
Map app = ActionContext.getContext().getApplication(); final OgnlValueStack stack = ActionContext.getContext().getValueStack();
private Map createExtraContext() { Map parentParams = null; if (!ignoreContextParams) { parentParams = new ActionContext(getStack().getContext()).getParameters(); } Map newParams = (parentParams != null) ? new HashMap(parentParams) : new HashMap(); if (parameters != null) { newParams.putAll(parameters); } ActionContext ctx = new ActionContext(stack.getContext()); ServletContext servletContext = (ServletContext) ctx.get(ServletActionContext.SERVLET_CONTEXT); PageContext pageContext = (PageContext) ctx.get(ServletActionContext.PAGE_CONTEXT); Map session = ctx.getSession(); Map application = ctx.getApplication(); DispatcherUtils.initialize(servletContext); DispatcherUtils du = DispatcherUtils.getInstance(); Map extraContext = du.createContextMap(new RequestMap(req), newParams, session, application, req, res, servletContext); OgnlValueStack newStack = new OgnlValueStack(stack); extraContext.put(ActionContext.VALUE_STACK, newStack); // add page context, such that ServletDispatcherResult will do an include extraContext.put(ServletActionContext.PAGE_CONTEXT, pageContext); return extraContext; }
((ApplicationAware) action).setApplication(context.getApplication());