Package org.g4studio.core.mvc.xstruts.chain.contexts

Examples of org.g4studio.core.mvc.xstruts.chain.contexts.ServletActionContext


   */
  public ActionForm createActionForm(ActionContext context) throws IllegalAccessException, InstantiationException {
    ActionServlet actionServlet = null;

    if (context instanceof ServletActionContext) {
      ServletActionContext saContext = (ServletActionContext) context;

      actionServlet = saContext.getActionServlet();
    }

    return createActionForm(actionServlet);
  }
View Full Code Here


        actions.put(type, action);
      }
    }

    if (action.getServlet() == null) {
      ServletActionContext saContext = (ServletActionContext) context;
      ActionServlet actionServlet = saContext.getActionServlet();

      action.setServlet(actionServlet);
    }

    return (action);
View Full Code Here

* @version $Rev: 421119 $ $Date: 2005-06-04 10:58:46 -0400 (Sat, 04 Jun 2005) $
*/
public class SetContentType extends AbstractSetContentType {
  // ------------------------------------------------------- Protected Methods
  protected void setContentType(ActionContext context, String contentType) {
    ServletActionContext swcontext = (ServletActionContext) context;
    HttpServletResponse response = swcontext.getResponse();

    response.setContentType(contentType);
  }
View Full Code Here

public class PopulateActionForm extends AbstractPopulateActionForm {
  private static final Log log = LogFactory.getLog(PopulateActionForm.class);

  // ------------------------------------------------------- Protected Methods
  protected void populate(ActionContext context, ActionConfig actionConfig, ActionForm actionForm) throws Exception {
    ServletActionContext saContext = (ServletActionContext) context;

    RequestUtils.populate(actionForm, actionConfig.getPrefix(), actionConfig.getSuffix(), saContext.getRequest());
  }
View Full Code Here

    RequestUtils.populate(actionForm, actionConfig.getPrefix(), actionConfig.getSuffix(), saContext.getRequest());
  }

  protected void reset(ActionContext context, ActionConfig actionConfig, ActionForm actionForm) {
    ServletActionContext saContext = (ServletActionContext) context;

    actionForm.reset((ActionMapping) actionConfig, saContext.getRequest());

    // Set the multipart class
    if (actionConfig.getMultipartClass() != null) {
      saContext.getRequestScope().put(Globals.MULTIPART_KEY, actionConfig.getMultipartClass());
    }
  }
View Full Code Here

* @version $Rev: 421119 $ $Date: 2005-05-07 12:11:38 -0400 (Sat, 07 May 2005) $
*/
public class SelectAction extends AbstractSelectAction {
  // ------------------------------------------------------- Protected Methods
  protected String getPath(ActionContext context) {
    ServletActionContext saContext = (ServletActionContext) context;
    HttpServletRequest request = saContext.getRequest();
    String path = null;
    boolean extension = false;

    // For prefix matching, match on the path info
    path = (String) request.getAttribute(Constants.INCLUDE_PATH_INFO);

    if (path == null) {
      path = request.getPathInfo();
    }

    // For extension matching, match on the servlet path
    if (path == null) {
      path = (String) request.getAttribute(Constants.INCLUDE_SERVLET_PATH);

      if (path == null) {
        path = request.getServletPath();
      }

      if (path == null) {
        throw new IllegalArgumentException("No path information in request");
      }

      extension = true;
    }

    // Strip the module prefix and extension (if any)
    ModuleConfig moduleConfig = saContext.getModuleConfig();
    String prefix = moduleConfig.getPrefix();

    if (!path.startsWith(prefix)) {
      throw new IllegalArgumentException("Path does not start with '" + prefix + "'");
    }
View Full Code Here

* @version $Rev: 421119 $ $Date: 2005-06-04 07:58:46 -0700 (Sat, 04 Jun 2005) $
*/
public class SetOriginalURI extends AbstractSetOriginalURI {
  // ------------------------------------------------------- Protected Methods
  protected void setOriginalURI(ActionContext context) {
    ServletActionContext swcontext = (ServletActionContext) context;
    HttpServletRequest request = swcontext.getRequest();

    request.setAttribute(Globals.ORIGINAL_URI_KEY, request.getServletPath());
  }
View Full Code Here

   *
   * @param context
   *            The <code>Context</code> for this request
   */
  protected Locale getLocale(ActionContext context) {
    ServletActionContext saContext = (ServletActionContext) context;

    // Has a Locale already been selected?
    HttpSession session = saContext.getRequest().getSession();
    Locale locale = (Locale) session.getAttribute(Globals.LOCALE_KEY);

    if (locale != null) {
      return (locale);
    }

    // Select and cache the Locale to be used
    locale = saContext.getRequest().getLocale();

    if (locale == null) {
      locale = Locale.getDefault();
    }

View Full Code Here

*/
public class SelectModule extends AbstractSelectModule {
  // ------------------------------------------------------- Protected Methods
  protected String getPrefix(ActionContext context) {
    // Identify the URI from which we will match a module prefix
    ServletActionContext sacontext = (ServletActionContext) context;
    HttpServletRequest request = sacontext.getRequest();
    String uri = (String) request.getAttribute(Constants.INCLUDE_SERVLET_PATH);

    if (uri == null) {
      uri = request.getServletPath();
    }

    if (uri == null) {
      throw new IllegalArgumentException("No path information in request");
    }

    // Identify the module prefix for the current module
    String prefix = ""; // Initialize to default prefix
    String[] prefixes = (String[]) sacontext.getApplicationScope().get(Globals.MODULE_PREFIXES_KEY);
    int lastSlash = 0;

    while (prefix.equals("") && ((lastSlash = uri.lastIndexOf("/")) > 0)) {
      uri = uri.substring(0, lastSlash);

View Full Code Here

* @version $Rev: 421119 $ $Date: 2005-05-07 12:11:38 -0400 (Sat, 07 May 2005) $
*/
public class RequestNoCache extends AbstractRequestNoCache {
  // ------------------------------------------------------- Protected Methods
  protected void requestNoCache(ActionContext context) {
    ServletActionContext sacontext = (ServletActionContext) context;
    HttpServletResponse response = sacontext.getResponse();

    response.setHeader("Pragma", "No-cache");
    response.setHeader("Cache-Control", "no-cache,no-store,max-age=0");
    response.setDateHeader("Expires", 1);
  }
View Full Code Here

TOP

Related Classes of org.g4studio.core.mvc.xstruts.chain.contexts.ServletActionContext

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.