Search code examples
webspherewebsphere-7websphere-8

allowing casual multipart parsing in websphere?


Asking it simply how to do allowing casual multipart parsing true in websphere as i know we use for tomcat in context.xml but as i am new to websphere no idea.Can anybody help me in this ?

Set to true if Tomcat should automatically parse multipart/form-data request bodies when HttpServletRequest.getPart* or HttpServletRequest.getParameter* is called, even when the target servlet isn't marked with the @MultipartConfig annotation (See Servlet Specification 3.0, Section 3.2 for details). Note that any setting other than false causes Tomcat to behave in a way that is not technically spec-compliant. The default is false.


Solution

  • Currently Websphere does not support parsing the multipart request bodies when the servlet is not setup according to the servlet spec. You can, however, set up the servlet to do so in the application's web.xml instead of using the annotation. For example:

    <servlet>
        <servlet-name>MyServlet</servlet-name>
        <multipart-config>
            <max-file-size>100000</max-file-size>
            <max-request-size>200000</max-request-size>
            <file-size-threshold>50000</file-size-threshold>
        </multipart-config>
    </servlet>
    

    https://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/cweb_webcontainer_behavior.html