net.balusc.http.multipart
クラス MultipartMap

java.lang.Object
  上位を拡張 java.util.AbstractMap<K,V>
      上位を拡張 java.util.HashMap<java.lang.String,java.lang.Object>
          上位を拡張 net.balusc.http.multipart.MultipartMap
すべての実装されたインタフェース:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,java.lang.Object>

public class MultipartMap
extends java.util.HashMap<java.lang.String,java.lang.Object>

MultipartMap 実装です。HttpServletRequest#getParameterXXX() メソッドをシュミレートして @MultipartConfig サーブレット中の処理を簡単にします。You can access the normal request parameters by getParameter(String) and you can access multiple request parameter values by getParameterValues(String).

On creation, the MultipartMap will put itself in the request scope, identified by the attribute name parts, so that you can access the parameters in EL by for example ${parts.fieldname} where you would have used ${param.fieldname}. In case of file fields, the ${parts.filefieldname} returns a UploadedFile.

It was a design decision to extend HashMap<String, Object> instead of having just Map<String, String[]> and Map<String, File> properties, because of the accessibility in Expression Language. Also, when the value is obtained by get(Object), as will happen in EL, then multiple parameter values will be converted from String[] to List<String>, so that you can use it in the JSTL fn:contains function.

作成者:
BalusC
関連項目:
直列化された形式

入れ子のクラスの概要
 
クラス java.util.AbstractMap から継承された入れ子のクラス/インタフェース
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
 
コンストラクタの概要
MultipartMap(javax.servlet.http.HttpServletRequest multipartRequest)
          Construct multipart map based on the given multipart request.
MultipartMap(javax.servlet.http.HttpServletRequest multipartRequest, javax.servlet.Servlet servlet)
          Construct multipart map based on the given multipart request and the servlet associated with the request.
 
メソッドの概要
 java.lang.Object get(java.lang.Object key)
           
 UploadedFile getFile(java.lang.String name)
          Returns uploaded file associated with given request parameter name.
 java.lang.String getParameter(java.lang.String name)
           
 java.util.Map<java.lang.String,java.lang.String[]> getParameterMap()
           
 java.util.Enumeration<java.lang.String> getParameterNames()
           
 java.lang.String[] getParameterValues(java.lang.String name)
           
 
クラス java.util.HashMap から継承されたメソッド
clear, clone, containsKey, containsValue, entrySet, isEmpty, keySet, put, putAll, remove, size, values
 
クラス java.util.AbstractMap から継承されたメソッド
equals, hashCode, toString
 
クラス java.lang.Object から継承されたメソッド
finalize, getClass, notify, notifyAll, wait, wait, wait
 
インタフェース java.util.Map から継承されたメソッド
equals, hashCode
 

コンストラクタの詳細

MultipartMap

public MultipartMap(javax.servlet.http.HttpServletRequest multipartRequest,
                    javax.servlet.Servlet servlet)
             throws javax.servlet.ServletException,
                    java.io.IOException
Construct multipart map based on the given multipart request and the servlet associated with the request. When the encoding is not specified in the given request, then it will default to UTF-8.

パラメータ:
multipartRequest - The multipart request to construct the multipart map for.
servlet - The servlet which is responsible for the given request.
例外:
javax.servlet.ServletException - If something fails at Servlet level.
java.io.IOException - If something fails at I/O level.

MultipartMap

public MultipartMap(javax.servlet.http.HttpServletRequest multipartRequest)
             throws javax.servlet.ServletException,
                    java.io.IOException
Construct multipart map based on the given multipart request. When the encoding is not specified in the given request, then it will default to UTF-8.

パラメータ:
multipartRequest - The multipart request to construct the multipart map for.
例外:
javax.servlet.ServletException - If something fails at Servlet level.
java.io.IOException - If something fails at I/O level.
メソッドの詳細

get

public java.lang.Object get(java.lang.Object key)
定義:
インタフェース java.util.Map<java.lang.String,java.lang.Object> 内の get
オーバーライド:
クラス java.util.HashMap<java.lang.String,java.lang.Object> 内の get

getParameter

public java.lang.String getParameter(java.lang.String name)
関連項目:
ServletRequest.getParameter(String)

getParameterValues

public java.lang.String[] getParameterValues(java.lang.String name)
関連項目:
ServletRequest.getParameterValues(String)

getParameterNames

public java.util.Enumeration<java.lang.String> getParameterNames()
関連項目:
ServletRequest.getParameterNames()

getParameterMap

public java.util.Map<java.lang.String,java.lang.String[]> getParameterMap()
関連項目:
ServletRequest.getParameterMap()

getFile

public UploadedFile getFile(java.lang.String name)
Returns uploaded file associated with given request parameter name.

パラメータ:
name - Request parameter name to return the associated uploaded file for.
戻り値:
Uploaded file associated with given request parameter name.
例外:
java.lang.IllegalArgumentException - If this field is actually a Text field.