Examples of ServletActionContext


Examples of org.apache.struts.chain.contexts.ServletActionContext

    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.apache.struts.action.ExceptionHandler handler =
            (org.apache.struts.action.ExceptionHandler) ClassUtils
            .getApplicationInstance(exceptionConfig.getHandler());
View Full Code Here

Examples of org.apache.struts.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.apache.struts.chain.contexts.ServletActionContext

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

Examples of org.apache.struts.chain.contexts.ServletActionContext

     * @param context The context for this request
     * @param uri     The uri to be included
     */
    protected void perform(ActionContext context, String uri)
        throws Exception {
        ServletActionContext swcontext = (ServletActionContext) context;

        HttpServletRequest request = swcontext.getRequest();

        RequestDispatcher rd = swcontext.getContext().getRequestDispatcher(uri);

        rd.forward(request, swcontext.getResponse());
    }
View Full Code Here

Examples of org.apache.struts.chain.contexts.ServletActionContext

    // ------------------------------------------------------- Protected Methods
    protected boolean isAuthorized(ActionContext context, String[] roles,
        ActionConfig mapping)
        throws Exception {
        // Identify the HTTP request object
        ServletActionContext servletActionContext =
            (ServletActionContext) context;
        HttpServletRequest request = servletActionContext.getRequest();

        // Check the current user against the list of required roles
        for (int i = 0; i < roles.length; i++) {
            if (request.isUserInRole(roles[i])) {
                return (true);
View Full Code Here

Examples of org.apache.struts.chain.contexts.ServletActionContext

        return (false);
    }

    protected String getErrorMessage(ActionContext context,
        ActionConfig actionConfig) {
        ServletActionContext servletActionContext =
            (ServletActionContext) context;

        // Retrieve internal message resources
        ActionServlet servlet = servletActionContext.getActionServlet();
        MessageResources resources = servlet.getInternal();

        return resources.getMessage("notAuthorized", actionConfig.getPath());
    }
View Full Code Here

Examples of org.apache.struts.chain.contexts.ServletActionContext

     * @param context       The context for this request
     * @param forwardConfig The forward to be performed
     */
    protected void perform(ActionContext context, ForwardConfig forwardConfig)
        throws Exception {
        ServletActionContext sacontext = (ServletActionContext) context;
        String uri = forwardConfig.getPath();

        if (uri == null) {
            ActionServlet servlet = sacontext.getActionServlet();
            MessageResources resources = servlet.getInternal();

            throw new IllegalArgumentException(resources.getMessage("forwardPathNull"));
        }

        HttpServletRequest request = sacontext.getRequest();
        ServletContext servletContext = sacontext.getContext();
        HttpServletResponse response = sacontext.getResponse();

        if (uri.startsWith("/")) {
            uri = resolveModuleRelativePath(forwardConfig, servletContext, request);
        }

View Full Code Here

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

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

        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

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

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