Package com.opensymphony.xwork

Examples of com.opensymphony.xwork.ActionContext$ActionContextThreadLocal


        JspFactory jspFactory = JspFactory.getDefaultFactory();

        PageContext pageContext = jspFactory.getPageContext(this, request, response, null, true, 8192, true);

        // put the new PageContext into ActionContext
        ActionContext actionContext = ActionContext.getContext();

        actionContext.put(ServletActionContext.PAGE_CONTEXT, pageContext);

        /*
         * Must put the stack into HttpServletRequest, because the WebWork JSP
         * Taglib will use it to judge whether there are some errors in stack.
         */
        OgnlValueStack stack = ActionContext.getContext().getValueStack();

        //request.setAttribute(ServletActionContext.WEBWORK_VALUESTACK_KEY,
        // stack);
        //Moved to WebWorkPortlet doService()

        VelocityManager velocityManager = VelocityManager.getInstance();
        Context resultContext = velocityManager.createContext(stack, request, response);

        response.setContentType("text/html");

        try {
            String location = (String) ActionContext.getContext().get("template");
            Template template = velocityManager.getVelocityEngine().getTemplate(location);

            Writer writer = pageContext.getOut();
            template.merge(resultContext, writer);
            writer.flush();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            // perform cleanup
            jspFactory.releasePageContext(pageContext);
            actionContext.put(ServletActionContext.PAGE_CONTEXT, oldPageContext);
        }

    }
View Full Code Here


            response.setContentType("text/html");

            PortletContext portletContext = (PortletContext) PortletMessaging.receive(request, "PortletContext");
            PortletContext.setContext(portletContext);

            ActionContext actionContext = (ActionContext) PortletMessaging.receive(request, "ActionContext");
            ActionContext.setContext(actionContext);

            PortletURL portletURL = response.createActionURL();
            String actionURL = portletURL.toString();
            PortletContext.getContext().setActionURL(actionURL);
View Full Code Here

    logger.debug("executing action");
    return go();
  }
 
  protected HttpServletResponse getServletResponse(){
    ActionContext ctx = ActionContext.getContext();
    return (HttpServletResponse)ctx.get(ServletActionContext.HTTP_RESPONSE);   
  }
View Full Code Here

    ActionContext ctx = ActionContext.getContext();
    return (HttpServletResponse)ctx.get(ServletActionContext.HTTP_RESPONSE);   
  }
 
  protected HttpServletRequest getServletRequest(){
    ActionContext ctx = ActionContext.getContext();
    return (HttpServletRequest)ctx.get(ServletActionContext.HTTP_REQUEST);
  }
View Full Code Here

  public void setUserManager(UserManager userManager) {
    this.userManager = userManager;
  }
 
  private User getUserFromRememberMeCookie(){
    ActionContext ctx = ActionContext.getContext();
    HttpServletRequest req = (HttpServletRequest)ctx.get(ServletActionContext.HTTP_REQUEST);
    Cookie[] cookies = req.getCookies();
    Cookie passKey = ServletUtilities.getCookie(cookies,SessionConstants.REMEMBER_ME);
    if(passKey != null){
      String val = passKey.getValue();
      String[] s = val.split(":");
View Full Code Here

    }

    private boolean operationAllowed( String permission, String repoid )
    {
        ActionContext context = ActionContext.getContext();
        SecuritySession securitySession = (SecuritySession) context.get( SecuritySession.ROLE );

        AuthorizationResult authzResult;
        try
        {
            authzResult = securitySystem.authorize( securitySession, permission, repoid );
View Full Code Here

public class ArchivaXworkUser
    implements ArchivaUser
{
    private Map<String, Object> getContextSession()
    {
        ActionContext context = ActionContext.getContext();
        Map<String, Object> sessionMap = context.getSession();
        if ( sessionMap == null )
        {
            sessionMap = new HashMap<String, Object>();
        }
View Full Code Here

public class ArchivaXworkUser
    implements ArchivaUser
{
    private Map<String, Object> getContextSession()
    {
        ActionContext context = ActionContext.getContext();
        Map<String, Object> sessionMap = context.getSession();
        if ( sessionMap == null )
        {
            sessionMap = new HashMap<String, Object>();
        }
View Full Code Here

    }

    private boolean operationAllowed( String permission, String repoid )
    {
        ActionContext context = ActionContext.getContext();
        SecuritySession securitySession = (SecuritySession) context.get( SecuritySession.ROLE );

        AuthorizationResult authzResult;
        try
        {
            authzResult = securitySystem.authorize( securitySession, permission, repoid );
View Full Code Here

        dbg.append( "\n    .namespace  =" ).append( proxy.getNamespace() );
        dbg.append( "\n    .actionName =" ).append( proxy.getActionName() );
        dbg.append( "\n    .method     =" ).append( proxy.getMethod() );
        dbg.append( "\n    .execute result =" ).append( proxy.getExecuteResult() );

        ActionContext context = invocation.getInvocationContext();
        dbg.append( "\n InvocationContext=" ).append( context.getClass().getName() );
        appendMap( "\n    .session=", dbg, context.getSession() );
        appendMap( "\n    .parameters=", dbg, context.getParameters() );

        String result = invocation.invoke();

        dbg.append( "\n ... result=\"" ).append( result ).append( "\"" );
        dbg.append( ", code=" ).append( invocation.getResultCode() );
View Full Code Here

TOP

Related Classes of com.opensymphony.xwork.ActionContext$ActionContextThreadLocal

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.