Examples of ServletActionContext


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

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

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

    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

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

* @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

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

* @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

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

   *
   * @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

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

*/
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

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

* @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

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

  // ------------------------------------------------------- Protected Methods
  protected ForwardConfig handle(ActionContext context, Exception exception, ExceptionConfig exceptionConfig,
      ActionConfig actionConfig, ModuleConfig moduleConfig) throws Exception {
    // Look up the remaining properties needed for this handler
    ServletActionContext sacontext = (ServletActionContext) context;
    ActionForm actionForm = (ActionForm) sacontext.getActionForm();
    HttpServletRequest request = sacontext.getRequest();
    HttpServletResponse response = sacontext.getResponse();

    // Handle this exception
    org.g4studio.core.mvc.xstruts.action.ExceptionHandler handler = (org.g4studio.core.mvc.xstruts.action.ExceptionHandler) ClassUtils
        .getApplicationInstance(exceptionConfig.getHandler());
View Full Code Here

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

   * @throws Exception
   *             if thrown by the <code>Action</code>
   */
  protected ForwardConfig execute(ActionContext context, Action action, ActionConfig actionConfig,
      ActionForm actionForm) throws Exception {
    ServletActionContext saContext = (ServletActionContext) context;

    return (action.execute((ActionMapping) actionConfig, actionForm, saContext.getRequest(),
        saContext.getResponse()));
  }
View Full Code Here

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

   *            The context for this request
   * @param actionForm
   *            The form bean for this request
   */
  protected ActionErrors validate(ActionContext context, ActionConfig actionConfig, ActionForm actionForm) {
    ServletActionContext saContext = (ServletActionContext) context;
    ActionErrors errors = (actionForm.validate((ActionMapping) actionConfig, saContext.getRequest()));

    // Special handling for multipart request
    if ((errors != null) && !errors.isEmpty()) {
      if (actionForm.getMultipartRequestHandler() != null) {
        if (log.isTraceEnabled()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.