【问题标题】:allowing casual multipart parsing in websphere?允许在 websphere 中进行随意的多部分解析?
【发布时间】:2015-12-11 11:27:55
【问题描述】:

简单地问它如何允许在 websphere 中进行随意的多部分解析,因为我知道我们在 context.xml 中用于 tomcat,但由于我是 websphere 的新手,所以不知道。有人可以帮助我吗?

如果 Tomcat 应该自动解析 multipart/form-data,则设置为 true 当 HttpServletRequest.getPart* 或 HttpServletRequest.getParameter* 被调用,即使在目标 servlet 未使用 @MultipartConfig 注释标记(请参阅 Servlet 规范 3.0,第 3.2 节了解详细信息)。请注意,任何设置 非 false 会导致 Tomcat 的行为方式不是 符合技术规范。默认为假。

【问题讨论】:

    标签: websphere websphere-7 websphere-8


    【解决方案1】:

    当前 Websphere 不支持在未根据 servlet 规范设置 servlet 时解析多部分请求正文。但是,您可以在应用程序的 web.xml 中设置 servlet,而不是使用注释。例如:

    <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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-11
      • 2015-12-18
      • 2020-12-10
      • 2010-09-17
      • 1970-01-01
      • 1970-01-01
      • 2021-07-24
      相关资源
      最近更新 更多