Get the current ActionResolver.
@deprecated Use {@link #getCurrentPageFlow(HttpServletRequest, ServletContext)} instead.

@return the current ActionResolver from the user session, or <code>null</code> if there is none.
359366
public static ActionResolver getCurrentActionResolver( HttpServletRequest request )
    {
        ServletContext servletContext = InternalUtils.getServletContext( request );
        return getCurrentActionResolver( request, servletContext );
    }
884360
public function current(){

        if($this->currentPageType !== false){
            return $this->currentPageType;
        }

        $this->currentPageType = null;

        if(!$path = $this->pathProvider->getCurrentCmsPath()){
            return;
        }

        $this->currentPageType = $path->getPageType();

        return $this->currentPageType;

    }
1180710
public static void setCurrentActionResolver( ActionResolver resolver, HttpServletRequest request,
                                                 ServletContext servletContext )
    {
        StorageHandler sh = Handlers.get( servletContext ).getStorageHandler();
        HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( request );
        RequestContext rc = new RequestContext( unwrappedRequest, null );
        String currentJpfAttrName =
            ScopedServletUtils.getScopedSessionAttrName( CURRENT_JPF_ATTR, unwrappedRequest );
        String currentLongLivedJpfAttrName =
                ScopedServletUtils.getScopedSessionAttrName( CURRENT_LONGLIVED_ATTR, unwrappedRequest );

        //
        // This case occurs when the previous page flow is no longer active and there is no new page flow
        //
        if ( resolver == null )
        {
            sh.removeAttribute( rc, currentJpfAttrName );
            sh.removeAttribute( rc, currentLongLivedJpfAttrName );
            return;
        }

        //
        // If this is a long-lived page flow, also store the instance in an attribute that never goes away.
        //
        if ( resolver.isPageFlow() && isLongLived( ( ( PageFlowController ) resolver ).theModuleConfig() ) )
        {
            String longLivedAttrName = getLongLivedFlowAttr( resolver.getModulePath() );
            longLivedAttrName = ScopedServletUtils.getScopedSessionAttrName( longLivedAttrName, unwrappedRequest );

            // Only set this attribute if it's not already there.  We want to avoid our onDestroy() callback that's
            // invoked when the page flow's session attribute is unbound.
            if ( sh.getAttribute( rc, longLivedAttrName ) != resolver )
            {
                sh.setAttribute( rc, longLivedAttrName, resolver );
            }

            sh.setAttribute( rc, currentLongLivedJpfAttrName, resolver.getModulePath() );
            sh.removeAttribute( rc, currentJpfAttrName );
        }
        //
        // Default case for removing a previous page flow in the presence of a new page flow.
        //
        else
        {
            sh.setAttribute( rc, currentJpfAttrName, resolver );
            sh.removeAttribute( rc, currentLongLivedJpfAttrName );
        }
    }
331475
public ActionForm getFormBean( ActionMapping mapping )
    {
        if ( mapping instanceof PageFlowActionMapping )
        {
            PageFlowActionMapping pfam = ( PageFlowActionMapping ) mapping;
            String formMember = pfam.getFormMember();
            if ( formMember == null ) return null;

            Field field = null;
            try
            {
                field = getClass().getDeclaredField( formMember );
            }
            catch ( NoSuchFieldException e )
            {
                // try finding a non-private field from the class hierarchy
                field = InternalUtils.lookupField( getClass(), formMember );
                if ( field == null || Modifier.isPrivate( field.getModifiers() ) )
                {
                     _log.error( "Could not find member field " + formMember + " as the form bean.");
                    return null;
                }
            }

            try
            {
                field.setAccessible( true );
                return InternalUtils.wrapFormBean( field.get( this ) );
            }
            catch ( Exception e )
            {
                _log.error( "Could not use member field " + formMember + " as the form bean.", e );
            }
        }

        return null;
    }
798064
public static SystemManager getCurrent()
  {
    SystemManager system = _systemLocal.get();

    if (system == null) {
      WeakReference<SystemManager> globalRef = _globalSystemRef;

      if (globalRef != null) {
        system = globalRef.get();
      }
    }

    return system;
  }
316310
public static FlowControllerFactory get( ServletContext servletContext )
    {
        FlowControllerFactory factory = ( FlowControllerFactory ) servletContext.getAttribute( CONTEXT_ATTR );
        assert factory != null
                : FlowControllerFactory.class.getName() + " was not found in ServletContext attribute " + CONTEXT_ATTR;
        factory.reinit( servletContext );
        return factory;
    }
998913
public static String getPageFlowClassName( String uri )
    {
        assert uri != null;
        assert uri.length() > 0;
        
        if ( uri.charAt( 0 ) == '/' ) uri = uri.substring( 1 );
        
        assert FileUtils.osSensitiveEndsWith( uri, PAGEFLOW_EXTENSION ) : uri;
        if ( FileUtils.osSensitiveEndsWith( uri, PAGEFLOW_EXTENSION ) ) 
        {
            uri = uri.substring( 0, uri.length() - PAGEFLOW_EXTENSION_LEN );
        }
        
        return uri.replace( '/', '.' );
    }
893093
@Restricted(DoNotUse.class)
    public static String getFrom() {
        String from = null, returnValue = null;
        final StaplerRequest request = Stapler.getCurrentRequest();

        // Try to obtain a return point either from the Session
        // or from the QueryParameter in this order
        if (request != null
                && request.getSession(false) != null) {
            from = (String) request.getSession().getAttribute("from");
        } else if (request != null) {
            from = request.getParameter("from");
        }

        // If entry point was not found, try to deduce it from the request URI
        // except pages related to login process
        if (from == null
                && request != null
                && request.getRequestURI() != null
                && !request.getRequestURI().equals("/loginError")
                && !request.getRequestURI().equals("/login")) {

                from = request.getRequestURI();
        }

        // If deduced entry point isn't deduced yet or the content is a blank value
        // use the root web point "/" as a fallback
        from = StringUtils.defaultIfBlank(from, "/").trim();
        
        // Encode the return value
        try {
            returnValue = java.net.URLEncoder.encode(from, "UTF-8");
        } catch (UnsupportedEncodingException e) { }

        // Return encoded value or at least "/" in the case exception occurred during encode()
        // or if the encoded content is blank value
        return StringUtils.isBlank(returnValue) ? "/" : returnValue;
    }
1208726
@Override
    public String getActor() {
        String actor = (String) RequestContextHolder.currentRequestAttributes()
                .getAttribute(actorSessionAttribute, RequestAttributes.SCOPE_SESSION);
        if (actor != null) {
            return actor;
        }
        return undefienedActorName;
    }
789698
public String getCurrentSessionId() {
        String currentId = null;
        Hashtable ht = (Hashtable) currentThreadSacHashtable.get();
        if (ht != null) {
            SessionAffinityContext sac = (SessionAffinityContext) ht.get(_smc.getSessionAffinityContextKey());
            if (sac != null) {
                currentId = _sam.getInUseSessionID(null, sac);
                // Make sure this is set if nothing was passed in.
                if (currentId == null) {
                    currentId = "NONE";
                }
            }
        }
        // If null is returned, this is considered to be a user spawned thread.
        return currentId;
    }
564000
PageFlowController popUntil( HttpServletRequest request, Class stopAt, boolean onlyIfPresent )
    {
        if (onlyIfPresent && lastIndexOf(stopAt) == -1) {
            return null;
        }
        
        while ( ! isEmpty()  )
        {
            PageFlowController popped = pop( request ).getPageFlow();
            
            if ( popped.getClass().equals( stopAt ) )
            {
                //
                // If we've popped everything from the stack, remove the stack attribute from the session.
                //
                if ( isEmpty() ) destroy( request );
                return popped;
            }
            else
            {
                //
                // We're discarding the popped page flow.  Invoke its destroy() callback, unless it's longLived.
                //
                if ( ! popped.isLongLived() ) popped.destroy( request.getSession( false ) );
            }
        }

        destroy( request );   // we're empty -- remove the attribute from the session.
        return null;
    }
915192
protected MavenImportWizardPage getMavenImportWizardPage() {
		if (this.mainPageBuffer == null) {
			try {
				final Field field = MavenImportWizard.class.getDeclaredField("page"); //$NON-NLS-1$
				field.setAccessible(true);
				this.mainPageBuffer = (MavenImportWizardPage) field.get(this);
			} catch (Exception exception) {
				throw new RuntimeException(exception);
			}
		}
		return this.mainPageBuffer;
	}
1171821
public String getCurrentLine() {
		if (!isCurrentLine()) {
			return null;
		}
		if (isTag(currentLine))
			return FlatFileUtils.trimRight(currentLine,
					getTagWidth(currentLine));
		else
			return currentLine.trim();
	}
628739
private JFXAlertAnimation getCurrentAnimation() {
        JFXAlertAnimation usedAnimation = getAnimation();
        usedAnimation = usedAnimation == null ? JFXAlertAnimation.NO_ANIMATION : usedAnimation;
        return usedAnimation;
    }
24996
public static String getToken(HttpServletRequest request, ActionMapping mapping)
    {
        if (mapping instanceof PageFlowActionMapping && ((PageFlowActionMapping) mapping).isPreventDoubleSubmit()) {
            HttpSession session = request.getSession();
            String token = (String) session.getAttribute(Globals.TRANSACTION_TOKEN_KEY);
            if (token != null) return token;
            token = TokenProcessor.getInstance().generateToken(request);
            request.getSession().setAttribute(Globals.TRANSACTION_TOKEN_KEY, token);
            return token;
        }

        return null;
    }
459606
void savePreviousActionInfo( ActionForm form, HttpServletRequest request, ActionMapping mapping,
                                 ServletContext servletContext )
    {
        //
        // Save this previous-action info in the *current page flow*.
        //
        PageFlowController currentJpf = PageFlowUtils.getCurrentPageFlow( request, getServletContext() );
        if ( currentJpf != null ) currentJpf.savePreviousActionInfo( form, request, mapping, servletContext );
    }
121786
public ServletContext getCurrentServletContext() {
        final ClassLoader cl = getContextClassLoader();
        if (cl == null) {
            return null;
        }
        return servletContexts.get(cl);
    }