Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p><em>Figured out that changing the encType of form to "application/x-www-form-urlencoded" from "multipart/form-data" resolves this issue. Strange though! Not sure why it didn't work with multipart encryption.</em></p> </blockquote> <p>First of all, it's not an encryption, but an encoding. The difference is pretty huge. "Encrypting" is a way of changing the value in such way which is not predictable without having kind of a security key (cipher key, seed, etc). "Encoding" is a way of changing the value in such way that it's acceptable by the data transfer mechanism and/or that it's recognizeable/parseable by the other side without loss of any data. The values are not made unreadable or something, they are just arranged somewhat specific and differently.</p> <p>Coming back to your concrete problem, the <code>multipart/formdata</code> encoding is usually only used when you need to be able to send (upload) a file along with the form, using for example <code>&lt;input type="file"&gt;</code> or the RichFaces <code>&lt;rich:fileUpload&gt;</code> component. The standard <code>application/x-www-form-urlencoded</code> form encoding, which basically specifies that the request parameters should be sent URL-encoded in this format</p> <pre class="lang-none prettyprint-override"><code>Content-Type: application/x-www-form-urlencoded;charset=UTF-8 name1=value1&amp;name2=value2&amp;name3=value3 </code></pre> <p>isn't suitable for passing file contents around. For that the <code>multipart/form-data</code> encoding should be used which basically look like this:</p> <pre class="lang-none prettyprint-override"><code>Content-Type: multipart/form-data;boundary=SOME_BOUNDARY --SOME_BOUNDARY content-disposition: form-data;name="name1" content-type: text/plain;charset=UTF-8 value1 --SOME_BOUNDARY content-disposition: form-data;name="name2" content-type: text/plain;charset=UTF-8 value2 --SOME_BOUNDARY content-disposition: form-data;name="name3" content-type: text/plain;charset=UTF-8 value3 --SOME_BOUNDARY-- </code></pre> <p>This format allows room for enclosing complete file contents in the request body. </p> <p>In a JSF 2.0/2.1 web application, <code>multipart/form-data</code> requests are normally processed by a custom <code>Filter</code>. In case of RichFaces 3, this is normally processed by the <code>org.ajax4jsf.Filter</code> which is missing in RichFaces 4. </p> <p>Note that the <code>application/x-www-form-urlencoded</code> is already the <strong>default</strong> encoding type of HTML forms. So you don't need to explicitly specify it yourself. Just omit the <code>enctype</code> attribute altogether:</p> <pre><code>&lt;h:form&gt; &lt;/h:form&gt; </code></pre> <p>and you should be all set.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload