Examples of MultipartRequestHandler


Examples of org.apache.struts.upload.MultipartRequestHandler

     */
    // @Struts: org.apache.struts.util.RequestUtils.getMultipartHandler
    private static final MultipartRequestHandler getMultipartHandler(HttpServletRequest request)
        throws ServletException
    {
        MultipartRequestHandler multipartHandler = null;
        String multipartClass = (String) request.getAttribute(Globals.MULTIPART_KEY);
        request.removeAttribute(Globals.MULTIPART_KEY);

        // Try to initialize the mapping specific request handler
        if (multipartClass != null) {
View Full Code Here

Examples of org.apache.struts.upload.MultipartRequestHandler

    {
        public RehydratedMultipartRequestWrapper( HttpServletRequest req )
        {
            super( req );

            MultipartRequestHandler handler = MultipartRequestUtils.getCachedMultipartHandler( req );

            if ( handler != null )
            {
                ScopedRequest scopedRequest = ScopedServletUtils.unwrapRequest( req );
                Map textElements = handler.getTextElements();
                parameters = scopedRequest != null ? scopedRequest.filterParameterMap( textElements ) : textElements;
            }
        }
View Full Code Here

Examples of org.apache.struts.upload.MultipartRequestHandler

                        + bean.getClass().getName()
                        + "\"");
            }

            // Obtain a MultipartRequestHandler
            MultipartRequestHandler multipartHandler = getMultipartHandler(request);

            // Set the multipart request handler for our ActionForm.
            // If the bean isn't an ActionForm, an exception would have been
            // thrown earlier, so it's safe to assume that our bean is
            // in fact an ActionForm.
             ((ActionForm) bean).setMultipartRequestHandler(multipartHandler);

            if (multipartHandler != null) {
                isMultipart = true;
                // Set servlet and mapping info
                servlet.setServletFor(multipartHandler);
                multipartHandler.setMapping(
                    (ActionMapping) request.getAttribute(Globals.MAPPING_KEY));
                // Initialize multipart request class handler
                multipartHandler.handleRequest(request);
                //stop here if the maximum length has been exceeded
                Boolean maxLengthExceeded =
                    (Boolean) request.getAttribute(
                        MultipartRequestHandler.ATTRIBUTE_MAX_LENGTH_EXCEEDED);
                if ((maxLengthExceeded != null) && (maxLengthExceeded.booleanValue())) {
View Full Code Here

Examples of org.apache.struts.upload.MultipartRequestHandler

     *                             to locate the multipart handler.
     */
    private static MultipartRequestHandler getMultipartHandler(HttpServletRequest request)
        throws ServletException {

        MultipartRequestHandler multipartHandler = null;
        String multipartClass = (String) request.getAttribute(Globals.MULTIPART_KEY);
        request.removeAttribute(Globals.MULTIPART_KEY);

        // Try to initialize the mapping specific request handler
        if (multipartClass != null) {
View Full Code Here

Examples of org.apache.struts.upload.MultipartRequestHandler

                        + bean.getClass().getName()
                        + "\"");
            }

            // Obtain a MultipartRequestHandler
            MultipartRequestHandler multipartHandler = getMultipartHandler(request);

            // Set the multipart request handler for our ActionForm.
            // If the bean isn't an ActionForm, an exception would have been
            // thrown earlier, so it's safe to assume that our bean is
            // in fact an ActionForm.
            ((ActionForm) bean).setMultipartRequestHandler(multipartHandler);

            if (multipartHandler != null) {
                isMultipart = true;
                // Set servlet and mapping info
                servlet.setServletFor(multipartHandler);
                multipartHandler.setMapping(
                        (ActionMapping) request.getAttribute(Globals.MAPPING_KEY));
                // Initialize multipart request class handler
                multipartHandler.handleRequest(request);
                //stop here if the maximum length has been exceeded
                Boolean maxLengthExceeded =
                        (Boolean) request.getAttribute(
                                MultipartRequestHandler.ATTRIBUTE_MAX_LENGTH_EXCEEDED);
                if ((maxLengthExceeded != null) && (maxLengthExceeded.booleanValue())) {
View Full Code Here

Examples of org.apache.struts.upload.MultipartRequestHandler

     *                             to locate the multipart handler.
     */
    private static MultipartRequestHandler getMultipartHandler(HttpServletRequest request)
            throws ServletException {

        MultipartRequestHandler multipartHandler = null;
        String multipartClass = (String) request.getAttribute(Globals.MULTIPART_KEY);
        request.removeAttribute(Globals.MULTIPART_KEY);

        // Try to initialize the mapping specific request handler
        if (multipartClass != null) {
View Full Code Here

Examples of org.apache.struts.upload.MultipartRequestHandler

    {
        public RehydratedMultipartRequestWrapper( HttpServletRequest req )
        {
            super( req );

            MultipartRequestHandler handler = MultipartRequestUtils.getCachedMultipartHandler( req );

            if ( handler != null )
            {
                ScopedRequest scopedRequest = ScopedServletUtils.unwrapRequest( req );
                Map textElements = handler.getTextElements();
                parameters = scopedRequest != null ? scopedRequest.filterParameterMap( textElements ) : textElements;
            }
        }
View Full Code Here

Examples of org.apache.struts.upload.MultipartRequestHandler

            // else if ( ! ( bean instanceof ActionForm ) )
            //     throw new ServletException
            //         ("bean that's supposed to be populated from a multipart request is not of type " +
            //          "\"org.apache.struts.action.ActionForm\", but type \"" + bean.getClass().getName() + "\"");
           
            MultipartRequestHandler multipartHandler = getCachedMultipartHandler(request);
            boolean preHandled = false;
           
            if (multipartHandler == null)
            {
                multipartHandler = getMultipartHandler(request);
            }
            else
            {
                preHandled = true;
            }
           
            if (bean != null)
            {
                bean.setMultipartRequestHandler(multipartHandler);
            }
           
            if(multipartHandler != null)
            {
                isMultipart = true;
               
                servlet.setServletFor(multipartHandler);
                multipartHandler.setMapping((ActionMapping)request.getAttribute(Globals.MAPPING_KEY));
               
                if (! preHandled)
                {
                    multipartHandler.handleRequest(request);
                }
               
                Boolean maxLengthExceeded = (Boolean)request.getAttribute(MultipartRequestHandler.ATTRIBUTE_MAX_LENGTH_EXCEEDED);
                if(maxLengthExceeded != null && maxLengthExceeded.booleanValue())
                {
View Full Code Here

Examples of org.apache.struts.upload.MultipartRequestHandler

     * Can be called early in the request processing cycle to cache a single multipart handler for the request.
     */
    static void preHandleMultipartRequest(HttpServletRequest request)
        throws ServletException
    {
        MultipartRequestHandler multipartHandler = getCachedMultipartHandler(request);
       
        if (multipartHandler == null)
        {
            multipartHandler = getMultipartHandler(request);
           
            if (multipartHandler != null)
            {
                //
                // Run the request through the handler, and cache the handler in the outer request.
                //
                multipartHandler.handleRequest(request);
                HttpServletRequest outerRequest = ScopedServletUtils.getOuterRequest(request);
                outerRequest.setAttribute(PREHANDLED_MULTIPART_REQUEST_ATTR, multipartHandler);
            }
        }
    }
View Full Code Here

Examples of org.apache.struts.upload.MultipartRequestHandler

     */
    // @Struts: org.apache.struts.util.RequestUtils.getMultipartHandler
    private static final MultipartRequestHandler getMultipartHandler(HttpServletRequest request)
        throws ServletException
    {
        MultipartRequestHandler multipartHandler = null;
        String multipartClass = (String) request.getAttribute(Globals.MULTIPART_KEY);
        request.removeAttribute(Globals.MULTIPART_KEY);

        // Try to initialize the mapping specific request handler
        if (multipartClass != null) {
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.