| |||||||||||
| Servlet support in MINERVA follows the Java servlet standard. See below for the list of servlet predicates defined in the package servlet. The meaning of these predicates corresponds one-to-one to their Java counterparts. For a servlet usage example see Servlet For a multipart/form-data servlet usage example see servlet/WEB-INF/minerva/test.min For multipart data upload support, MINERVA offers a compact set of convenience predicates:
multipart_has_more_elements/1 multipart_next_element/2 multipart_get_content/2 multipart_get_content/3 multipart_get_stream/2 multipart_copyfile/2 multipart_create/2 multipart_create/3
multipart_create(+HttpServletRequest, -MultiPartFilter)The predicate returns for a multipart/form-data request a multipart filter, which can from then on be used to extract the individual user data.
multipart_create(+HttpServletRequest, +Encoding, -MultiPartFilter)The predicate returns for a multipart/form-data request with expected encoding a multipart filter, which can from then on be used to extract the individual user data.
multipart_has_more_elements(+MultiPartFilter)The predicate returns true if there exist other not yet processed multipart/form-data sections. Otherwise, the predicate fails.
multipart_next_element(+MultiPartFilter, -HeaderList)The predicate switches the filter to the next part and returns in 'HeaderList' the HttpParameters of that part. 'HeaderList' is a list of terms like [http(HttpHeaderName,HttpHeaderValue,[OptionName=OptionValue,...]),...] . In 'HeaderName' and 'OptionsName' all capital letters are converted to small letters. e.g. [http('content-disposition','form-data', [name = 'File', filename = 'test.html']), http('content-type', 'text/html', [])]
multipart_get_content(+MultiPartFilter, -Content)The predicate returns the content of a form-data part as an atom. (Assumed is that the characters are ISO-8859-1).
multipart_get_content(+MultiPartFilter, +Encoding, -Content)The predicate returns the content of a form-data part as an atom. 'Encoding' is an atom that gives the character encoding.
multipart_get_stream(+MultiPartFilter, -InputStream)The predicate returns an InputStream for the data of the next part. Usually this InputStream will be converted into a MinervaStream with open/4. e.g. open(InputStream,read,Stream,[stream,binary]) .
multipart_copyfile(+MultiPartFilter, +Filename)The predicate copies the contents of a form-data part into a file named Filename.
List of servlet predicates
multipart_has_more_elements/1, multipart_next_element/2, multipart_get_content/2, multipart_get_content/3, multipart_get_stream/2, multipart_copyfile/2, multipart_create/2, | |||||||||||
| |||||||||||
| Back> |
|