[ 
https://issues.apache.org/jira/browse/CAMEL-10492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15676309#comment-15676309
 ] 

Fabrizio Spataro edited comment on CAMEL-10492 at 11/18/16 9:38 AM:
--------------------------------------------------------------------

i am reading camel source code.

Into camel 2.18 the attribute atttachmentMultipartBinding is never set

(look at 
https://github.com/apache/camel/search?utf8=%E2%9C%93&q=setAttachmentMultipartBinding)

{code:java}
    /**
     * Whether to automatic bind multipart/form-data as attachments on the 
Camel {@link Exchange}.
     * <p/>
     * This is turn off by default as this may require servet specific 
configuration to enable this when using Servlet's.
     */
public void setAttachmentMultipartBinding(boolean attachmentMultipartBinding) {
        this.attachmentMultipartBinding = attachmentMultipartBinding;
    }
{code}

so this check is always false:

{code:java}
public class ServletEndpoint extends HttpCommonEndpoint {
.....
.....
public HttpBinding getHttpBinding() {
        // make sure we include servlet variant of the http binding
        if (this.binding == null) {
            // is attachment binding enabled?
            if (getComponent().isAttachmentMultipartBinding()) {
                this.binding = new AttachmentHttpBinding();
            } else {
                this.binding = new DefaultHttpBinding();
            }
          ....... 
          .......
        }
        return this.binding;
    }
{code}


was (Author: fabryprog):
i am reading camel source code.

Into camel 2.18 the attribute atttachmentMultipartBinding is never set

(look at 
https://github.com/apache/camel/search?utf8=%E2%9C%93&q=setAttachmentMultipartBinding)

{code:java}
    /**
     * Whether to automatic bind multipart/form-data as attachments on the 
Camel {@link Exchange}.
     * <p/>
     * This is turn off by default as this may require servet specific 
configuration to enable this when using Servlet's.
     */
public void setAttachmentMultipartBinding(boolean attachmentMultipartBinding) {
        this.attachmentMultipartBinding = attachmentMultipartBinding;
    }
{code}

> Camel Servlet, headers instance of String
> -----------------------------------------
>
>                 Key: CAMEL-10492
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10492
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-servlet
>            Reporter: Fabrizio Spataro
>            Priority: Minor
>         Attachments: camel-example-servlet-attachment.zip
>
>
> Since 2.18 i have a new bug!
> I send a multipart form data to my camel servlet, before camel 2.18 i have an 
> *attachment object* every form field.
> Now i have an *header* every form field.
> It is ok but ALL header (form field) are instance of java.lang.String
> So, I can not post any binary file.
> Is it a camel bug? 
> This is my filter into web.xml
> {code:xml}
>       <filter>
>               <filter-name>MultipartFilter</filter-name>
>               
> <filter-class>org.eclipse.jetty.servlets.MultiPartFilter</filter-class>
>       </filter>
>       <filter-mapping>
>               <filter-name>MultipartFilter</filter-name>
>               <servlet-name>CamelServlet</servlet-name>
>       </filter-mapping>
> {code}
> Into zip file, you can found an example.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to