juneau-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamesbog...@apache.org
Subject [09/51] [partial] juneau-website git commit: Update javadocs.
Date Fri, 29 Dec 2017 15:52:55 GMT
http://git-wip-us.apache.org/repos/asf/juneau-website/blob/25d34ae9/content/site/apidocs/src-html/org/apache/juneau/rest/RestRequest.html
----------------------------------------------------------------------
diff --git a/content/site/apidocs/src-html/org/apache/juneau/rest/RestRequest.html b/content/site/apidocs/src-html/org/apache/juneau/rest/RestRequest.html
index 6c4b552..b0d92f2 100644
--- a/content/site/apidocs/src-html/org/apache/juneau/rest/RestRequest.html
+++ b/content/site/apidocs/src-html/org/apache/juneau/rest/RestRequest.html
@@ -43,155 +43,155 @@
 <span class="sourceLineNo">035</span>import org.apache.juneau.encoders.*;<a name="line.35"></a>
 <span class="sourceLineNo">036</span>import org.apache.juneau.html.*;<a name="line.36"></a>
 <span class="sourceLineNo">037</span>import org.apache.juneau.http.*;<a name="line.37"></a>
-<span class="sourceLineNo">038</span>import org.apache.juneau.ini.*;<a name="line.38"></a>
-<span class="sourceLineNo">039</span>import org.apache.juneau.internal.*;<a name="line.39"></a>
-<span class="sourceLineNo">040</span>import org.apache.juneau.parser.*;<a name="line.40"></a>
-<span class="sourceLineNo">041</span>import org.apache.juneau.rest.widget.*;<a name="line.41"></a>
-<span class="sourceLineNo">042</span>import org.apache.juneau.serializer.*;<a name="line.42"></a>
-<span class="sourceLineNo">043</span>import org.apache.juneau.svl.*;<a name="line.43"></a>
-<span class="sourceLineNo">044</span>import org.apache.juneau.uon.*;<a name="line.44"></a>
-<span class="sourceLineNo">045</span>import org.apache.juneau.urlencoding.*;<a name="line.45"></a>
-<span class="sourceLineNo">046</span>import org.apache.juneau.utils.*;<a name="line.46"></a>
-<span class="sourceLineNo">047</span><a name="line.47"></a>
-<span class="sourceLineNo">048</span>/**<a name="line.48"></a>
-<span class="sourceLineNo">049</span> * Represents an HTTP request for a REST resource.<a name="line.49"></a>
-<span class="sourceLineNo">050</span> *<a name="line.50"></a>
-<span class="sourceLineNo">051</span> * &lt;p&gt;<a name="line.51"></a>
-<span class="sourceLineNo">052</span> * Equivalent to {@link HttpServletRequest} except with some additional convenience methods.<a name="line.52"></a>
-<span class="sourceLineNo">053</span> *<a name="line.53"></a>
-<span class="sourceLineNo">054</span> * &lt;p&gt;<a name="line.54"></a>
-<span class="sourceLineNo">055</span> * For reference, given the URL &lt;js&gt;"http://localhost:9080/contextRoot/servletPath/foo?bar=baz#qux"&lt;/js&gt;, the<a name="line.55"></a>
-<span class="sourceLineNo">056</span> * following methods return the following values....<a name="line.56"></a>
-<span class="sourceLineNo">057</span> * &lt;table class='styled'&gt;<a name="line.57"></a>
-<span class="sourceLineNo">058</span> *    &lt;tr&gt;&lt;th&gt;Method&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;/tr&gt;<a name="line.58"></a>
-<span class="sourceLineNo">059</span> *    &lt;tr&gt;&lt;td&gt;{@code getContextPath()}&lt;/td&gt;&lt;td&gt;{@code /contextRoot}&lt;/td&gt;&lt;/tr&gt;<a name="line.59"></a>
-<span class="sourceLineNo">060</span> *    &lt;tr&gt;&lt;td&gt;{@code getPathInfo()}&lt;/td&gt;&lt;td&gt;{@code /foo}&lt;/td&gt;&lt;/tr&gt;<a name="line.60"></a>
-<span class="sourceLineNo">061</span> *    &lt;tr&gt;&lt;td&gt;{@code getPathTranslated()}&lt;/td&gt;&lt;td&gt;{@code path-to-deployed-war-on-filesystem/foo}&lt;/td&gt;&lt;/tr&gt;<a name="line.61"></a>
-<span class="sourceLineNo">062</span> *    &lt;tr&gt;&lt;td&gt;{@code getQueryString()}&lt;/td&gt;&lt;td&gt;{@code bar=baz}&lt;/td&gt;&lt;/tr&gt;<a name="line.62"></a>
-<span class="sourceLineNo">063</span> *    &lt;tr&gt;&lt;td&gt;{@code getRequestURI()}&lt;/td&gt;&lt;td&gt;{@code /contextRoot/servletPath/foo}&lt;/td&gt;&lt;/tr&gt;<a name="line.63"></a>
-<span class="sourceLineNo">064</span> *    &lt;tr&gt;&lt;td&gt;{@code getRequestURL()}&lt;/td&gt;&lt;td&gt;{@code http://localhost:9080/contextRoot/servletPath/foo}&lt;/td&gt;&lt;/tr&gt;<a name="line.64"></a>
-<span class="sourceLineNo">065</span> *    &lt;tr&gt;&lt;td&gt;{@code getServletPath()}&lt;/td&gt;&lt;td&gt;{@code /servletPath}&lt;/td&gt;&lt;/tr&gt;<a name="line.65"></a>
-<span class="sourceLineNo">066</span> * &lt;/table&gt;<a name="line.66"></a>
-<span class="sourceLineNo">067</span> *<a name="line.67"></a>
-<span class="sourceLineNo">068</span> * &lt;p&gt;<a name="line.68"></a>
-<span class="sourceLineNo">069</span> * Refer to &lt;a class="doclink" href="package-summary.html#TOC"&gt;REST Servlet API&lt;/a&gt; for information about using this<a name="line.69"></a>
-<span class="sourceLineNo">070</span> * class.<a name="line.70"></a>
-<span class="sourceLineNo">071</span> */<a name="line.71"></a>
-<span class="sourceLineNo">072</span>@SuppressWarnings({ "unchecked", "unused" })<a name="line.72"></a>
-<span class="sourceLineNo">073</span>public final class RestRequest extends HttpServletRequestWrapper {<a name="line.73"></a>
-<span class="sourceLineNo">074</span><a name="line.74"></a>
-<span class="sourceLineNo">075</span>   private final RestContext context;<a name="line.75"></a>
-<span class="sourceLineNo">076</span><a name="line.76"></a>
-<span class="sourceLineNo">077</span>   private final String method;<a name="line.77"></a>
-<span class="sourceLineNo">078</span>   private RequestBody body;<a name="line.78"></a>
-<span class="sourceLineNo">079</span>   private Method javaMethod;<a name="line.79"></a>
-<span class="sourceLineNo">080</span>   private ObjectMap properties;<a name="line.80"></a>
-<span class="sourceLineNo">081</span>   private SerializerGroup serializerGroup;<a name="line.81"></a>
-<span class="sourceLineNo">082</span>   private ParserGroup parserGroup;<a name="line.82"></a>
-<span class="sourceLineNo">083</span>   private final boolean debug;<a name="line.83"></a>
-<span class="sourceLineNo">084</span>   private UrlEncodingParser urlEncodingParser;   // The parser used to parse URL attributes and parameters (beanContext also used to parse headers)<a name="line.84"></a>
-<span class="sourceLineNo">085</span>   private BeanSession beanSession;<a name="line.85"></a>
-<span class="sourceLineNo">086</span>   private VarResolverSession varSession;<a name="line.86"></a>
-<span class="sourceLineNo">087</span>   private final RequestQuery queryParams;<a name="line.87"></a>
-<span class="sourceLineNo">088</span>   private RequestFormData formData;<a name="line.88"></a>
-<span class="sourceLineNo">089</span>   private Map&lt;String,String&gt; defFormData;<a name="line.89"></a>
-<span class="sourceLineNo">090</span>   private RequestPathMatch pathParams;<a name="line.90"></a>
-<span class="sourceLineNo">091</span>   private boolean isPost;<a name="line.91"></a>
-<span class="sourceLineNo">092</span>   private UriContext uriContext;<a name="line.92"></a>
-<span class="sourceLineNo">093</span>   private String charset, defaultCharset;<a name="line.93"></a>
-<span class="sourceLineNo">094</span>   private RequestHeaders headers;<a name="line.94"></a>
-<span class="sourceLineNo">095</span>   private ConfigFile cf;<a name="line.95"></a>
-<span class="sourceLineNo">096</span>   private Swagger swagger, fileSwagger;<a name="line.96"></a>
-<span class="sourceLineNo">097</span>   private Map&lt;String,Widget&gt; widgets;<a name="line.97"></a>
-<span class="sourceLineNo">098</span><a name="line.98"></a>
-<span class="sourceLineNo">099</span>   /**<a name="line.99"></a>
-<span class="sourceLineNo">100</span>    * Constructor.<a name="line.100"></a>
-<span class="sourceLineNo">101</span>    */<a name="line.101"></a>
-<span class="sourceLineNo">102</span>   RestRequest(RestContext context, HttpServletRequest req) throws ServletException {<a name="line.102"></a>
-<span class="sourceLineNo">103</span>      super(req);<a name="line.103"></a>
-<span class="sourceLineNo">104</span>      this.context = context;<a name="line.104"></a>
-<span class="sourceLineNo">105</span><a name="line.105"></a>
-<span class="sourceLineNo">106</span>      try {<a name="line.106"></a>
-<span class="sourceLineNo">107</span>         isPost = req.getMethod().equalsIgnoreCase("POST");<a name="line.107"></a>
-<span class="sourceLineNo">108</span><a name="line.108"></a>
-<span class="sourceLineNo">109</span>         // If this is a POST, we want to parse the query parameters ourselves to prevent<a name="line.109"></a>
-<span class="sourceLineNo">110</span>         // the servlet code from processing the HTTP body as URL-Encoded parameters.<a name="line.110"></a>
-<span class="sourceLineNo">111</span>         queryParams = new RequestQuery();<a name="line.111"></a>
-<span class="sourceLineNo">112</span>         if (isPost)<a name="line.112"></a>
-<span class="sourceLineNo">113</span>            context.getUrlEncodingParser().parseIntoSimpleMap(getQueryString(), queryParams);<a name="line.113"></a>
-<span class="sourceLineNo">114</span>         else<a name="line.114"></a>
-<span class="sourceLineNo">115</span>            queryParams.putAll(req.getParameterMap());<a name="line.115"></a>
-<span class="sourceLineNo">116</span><a name="line.116"></a>
+<span class="sourceLineNo">038</span>import org.apache.juneau.httppart.*;<a name="line.38"></a>
+<span class="sourceLineNo">039</span>import org.apache.juneau.ini.*;<a name="line.39"></a>
+<span class="sourceLineNo">040</span>import org.apache.juneau.internal.*;<a name="line.40"></a>
+<span class="sourceLineNo">041</span>import org.apache.juneau.parser.*;<a name="line.41"></a>
+<span class="sourceLineNo">042</span>import org.apache.juneau.rest.widget.*;<a name="line.42"></a>
+<span class="sourceLineNo">043</span>import org.apache.juneau.serializer.*;<a name="line.43"></a>
+<span class="sourceLineNo">044</span>import org.apache.juneau.svl.*;<a name="line.44"></a>
+<span class="sourceLineNo">045</span>import org.apache.juneau.uon.*;<a name="line.45"></a>
+<span class="sourceLineNo">046</span>import org.apache.juneau.urlencoding.*;<a name="line.46"></a>
+<span class="sourceLineNo">047</span>import org.apache.juneau.utils.*;<a name="line.47"></a>
+<span class="sourceLineNo">048</span><a name="line.48"></a>
+<span class="sourceLineNo">049</span>/**<a name="line.49"></a>
+<span class="sourceLineNo">050</span> * Represents an HTTP request for a REST resource.<a name="line.50"></a>
+<span class="sourceLineNo">051</span> *<a name="line.51"></a>
+<span class="sourceLineNo">052</span> * &lt;p&gt;<a name="line.52"></a>
+<span class="sourceLineNo">053</span> * Equivalent to {@link HttpServletRequest} except with some additional convenience methods.<a name="line.53"></a>
+<span class="sourceLineNo">054</span> *<a name="line.54"></a>
+<span class="sourceLineNo">055</span> * &lt;p&gt;<a name="line.55"></a>
+<span class="sourceLineNo">056</span> * For reference, given the URL &lt;js&gt;"http://localhost:9080/contextRoot/servletPath/foo?bar=baz#qux"&lt;/js&gt;, the<a name="line.56"></a>
+<span class="sourceLineNo">057</span> * following methods return the following values....<a name="line.57"></a>
+<span class="sourceLineNo">058</span> * &lt;table class='styled'&gt;<a name="line.58"></a>
+<span class="sourceLineNo">059</span> *    &lt;tr&gt;&lt;th&gt;Method&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;/tr&gt;<a name="line.59"></a>
+<span class="sourceLineNo">060</span> *    &lt;tr&gt;&lt;td&gt;{@code getContextPath()}&lt;/td&gt;&lt;td&gt;{@code /contextRoot}&lt;/td&gt;&lt;/tr&gt;<a name="line.60"></a>
+<span class="sourceLineNo">061</span> *    &lt;tr&gt;&lt;td&gt;{@code getPathInfo()}&lt;/td&gt;&lt;td&gt;{@code /foo}&lt;/td&gt;&lt;/tr&gt;<a name="line.61"></a>
+<span class="sourceLineNo">062</span> *    &lt;tr&gt;&lt;td&gt;{@code getPathTranslated()}&lt;/td&gt;&lt;td&gt;{@code path-to-deployed-war-on-filesystem/foo}&lt;/td&gt;&lt;/tr&gt;<a name="line.62"></a>
+<span class="sourceLineNo">063</span> *    &lt;tr&gt;&lt;td&gt;{@code getQueryString()}&lt;/td&gt;&lt;td&gt;{@code bar=baz}&lt;/td&gt;&lt;/tr&gt;<a name="line.63"></a>
+<span class="sourceLineNo">064</span> *    &lt;tr&gt;&lt;td&gt;{@code getRequestURI()}&lt;/td&gt;&lt;td&gt;{@code /contextRoot/servletPath/foo}&lt;/td&gt;&lt;/tr&gt;<a name="line.64"></a>
+<span class="sourceLineNo">065</span> *    &lt;tr&gt;&lt;td&gt;{@code getRequestURL()}&lt;/td&gt;&lt;td&gt;{@code http://localhost:9080/contextRoot/servletPath/foo}&lt;/td&gt;&lt;/tr&gt;<a name="line.65"></a>
+<span class="sourceLineNo">066</span> *    &lt;tr&gt;&lt;td&gt;{@code getServletPath()}&lt;/td&gt;&lt;td&gt;{@code /servletPath}&lt;/td&gt;&lt;/tr&gt;<a name="line.66"></a>
+<span class="sourceLineNo">067</span> * &lt;/table&gt;<a name="line.67"></a>
+<span class="sourceLineNo">068</span> *<a name="line.68"></a>
+<span class="sourceLineNo">069</span> * &lt;p&gt;<a name="line.69"></a>
+<span class="sourceLineNo">070</span> * Refer to &lt;a class="doclink" href="package-summary.html#TOC"&gt;REST Servlet API&lt;/a&gt; for information about using this<a name="line.70"></a>
+<span class="sourceLineNo">071</span> * class.<a name="line.71"></a>
+<span class="sourceLineNo">072</span> */<a name="line.72"></a>
+<span class="sourceLineNo">073</span>@SuppressWarnings({ "unchecked", "unused" })<a name="line.73"></a>
+<span class="sourceLineNo">074</span>public final class RestRequest extends HttpServletRequestWrapper {<a name="line.74"></a>
+<span class="sourceLineNo">075</span><a name="line.75"></a>
+<span class="sourceLineNo">076</span>   private final RestContext context;<a name="line.76"></a>
+<span class="sourceLineNo">077</span><a name="line.77"></a>
+<span class="sourceLineNo">078</span>   private final String method;<a name="line.78"></a>
+<span class="sourceLineNo">079</span>   private RequestBody body;<a name="line.79"></a>
+<span class="sourceLineNo">080</span>   private Method javaMethod;<a name="line.80"></a>
+<span class="sourceLineNo">081</span>   private ObjectMap properties;<a name="line.81"></a>
+<span class="sourceLineNo">082</span>   private SerializerGroup serializerGroup;<a name="line.82"></a>
+<span class="sourceLineNo">083</span>   private ParserGroup parserGroup;<a name="line.83"></a>
+<span class="sourceLineNo">084</span>   private final boolean debug;<a name="line.84"></a>
+<span class="sourceLineNo">085</span>   private HttpPartParser partParser;<a name="line.85"></a>
+<span class="sourceLineNo">086</span>   private BeanSession beanSession;<a name="line.86"></a>
+<span class="sourceLineNo">087</span>   private VarResolverSession varSession;<a name="line.87"></a>
+<span class="sourceLineNo">088</span>   private final RequestQuery queryParams;<a name="line.88"></a>
+<span class="sourceLineNo">089</span>   private RequestFormData formData;<a name="line.89"></a>
+<span class="sourceLineNo">090</span>   private Map&lt;String,String&gt; defFormData;<a name="line.90"></a>
+<span class="sourceLineNo">091</span>   private RequestPathMatch pathParams;<a name="line.91"></a>
+<span class="sourceLineNo">092</span>   private boolean isPost;<a name="line.92"></a>
+<span class="sourceLineNo">093</span>   private UriContext uriContext;<a name="line.93"></a>
+<span class="sourceLineNo">094</span>   private String charset, defaultCharset;<a name="line.94"></a>
+<span class="sourceLineNo">095</span>   private RequestHeaders headers;<a name="line.95"></a>
+<span class="sourceLineNo">096</span>   private ConfigFile cf;<a name="line.96"></a>
+<span class="sourceLineNo">097</span>   private Swagger swagger, fileSwagger;<a name="line.97"></a>
+<span class="sourceLineNo">098</span>   private Map&lt;String,Widget&gt; widgets;<a name="line.98"></a>
+<span class="sourceLineNo">099</span><a name="line.99"></a>
+<span class="sourceLineNo">100</span>   /**<a name="line.100"></a>
+<span class="sourceLineNo">101</span>    * Constructor.<a name="line.101"></a>
+<span class="sourceLineNo">102</span>    */<a name="line.102"></a>
+<span class="sourceLineNo">103</span>   RestRequest(RestContext context, HttpServletRequest req) throws ServletException {<a name="line.103"></a>
+<span class="sourceLineNo">104</span>      super(req);<a name="line.104"></a>
+<span class="sourceLineNo">105</span>      this.context = context;<a name="line.105"></a>
+<span class="sourceLineNo">106</span><a name="line.106"></a>
+<span class="sourceLineNo">107</span>      try {<a name="line.107"></a>
+<span class="sourceLineNo">108</span>         isPost = req.getMethod().equalsIgnoreCase("POST");<a name="line.108"></a>
+<span class="sourceLineNo">109</span><a name="line.109"></a>
+<span class="sourceLineNo">110</span>         // If this is a POST, we want to parse the query parameters ourselves to prevent<a name="line.110"></a>
+<span class="sourceLineNo">111</span>         // the servlet code from processing the HTTP body as URL-Encoded parameters.<a name="line.111"></a>
+<span class="sourceLineNo">112</span>         queryParams = new RequestQuery();<a name="line.112"></a>
+<span class="sourceLineNo">113</span>         if (isPost) <a name="line.113"></a>
+<span class="sourceLineNo">114</span>            RestUtils.parseQuery(getQueryString(), queryParams);<a name="line.114"></a>
+<span class="sourceLineNo">115</span>         else<a name="line.115"></a>
+<span class="sourceLineNo">116</span>            queryParams.putAll(req.getParameterMap());<a name="line.116"></a>
 <span class="sourceLineNo">117</span><a name="line.117"></a>
-<span class="sourceLineNo">118</span>         // Get the HTTP method.<a name="line.118"></a>
-<span class="sourceLineNo">119</span>         // Can be overridden through a "method" GET attribute.<a name="line.119"></a>
-<span class="sourceLineNo">120</span>         String _method = super.getMethod();<a name="line.120"></a>
-<span class="sourceLineNo">121</span><a name="line.121"></a>
-<span class="sourceLineNo">122</span>         String m = getQuery().getString("method");<a name="line.122"></a>
-<span class="sourceLineNo">123</span>         if (context.allowMethodParam(m))<a name="line.123"></a>
-<span class="sourceLineNo">124</span>            _method = m;<a name="line.124"></a>
-<span class="sourceLineNo">125</span><a name="line.125"></a>
-<span class="sourceLineNo">126</span>         method = _method;<a name="line.126"></a>
-<span class="sourceLineNo">127</span><a name="line.127"></a>
-<span class="sourceLineNo">128</span>         headers = new RequestHeaders();<a name="line.128"></a>
-<span class="sourceLineNo">129</span>         for (Enumeration&lt;String&gt; e = getHeaderNames(); e.hasMoreElements();) {<a name="line.129"></a>
-<span class="sourceLineNo">130</span>            String name = e.nextElement();<a name="line.130"></a>
-<span class="sourceLineNo">131</span>            headers.put(name, super.getHeaders(name));<a name="line.131"></a>
-<span class="sourceLineNo">132</span>         }<a name="line.132"></a>
-<span class="sourceLineNo">133</span><a name="line.133"></a>
-<span class="sourceLineNo">134</span>         body = new RequestBody(this);<a name="line.134"></a>
-<span class="sourceLineNo">135</span><a name="line.135"></a>
-<span class="sourceLineNo">136</span>         if (context.isAllowBodyParam()) {<a name="line.136"></a>
-<span class="sourceLineNo">137</span>            String b = getQuery().getString("body");<a name="line.137"></a>
-<span class="sourceLineNo">138</span>            if (b != null) {<a name="line.138"></a>
-<span class="sourceLineNo">139</span>               headers.put("Content-Type", UonSerializer.DEFAULT.getResponseContentType());<a name="line.139"></a>
-<span class="sourceLineNo">140</span>               body.load(b.getBytes(UTF8));<a name="line.140"></a>
-<span class="sourceLineNo">141</span>            }<a name="line.141"></a>
-<span class="sourceLineNo">142</span>         }<a name="line.142"></a>
-<span class="sourceLineNo">143</span><a name="line.143"></a>
-<span class="sourceLineNo">144</span>         if (context.isAllowHeaderParams())<a name="line.144"></a>
-<span class="sourceLineNo">145</span>            headers.setQueryParams(queryParams);<a name="line.145"></a>
-<span class="sourceLineNo">146</span><a name="line.146"></a>
-<span class="sourceLineNo">147</span>         debug = "true".equals(getQuery().getString("debug", "false")) || "true".equals(getHeaders().getString("Debug", "false"));<a name="line.147"></a>
-<span class="sourceLineNo">148</span><a name="line.148"></a>
-<span class="sourceLineNo">149</span>         this.pathParams = new RequestPathMatch();<a name="line.149"></a>
-<span class="sourceLineNo">150</span><a name="line.150"></a>
-<span class="sourceLineNo">151</span>      } catch (RestException e) {<a name="line.151"></a>
-<span class="sourceLineNo">152</span>         throw e;<a name="line.152"></a>
-<span class="sourceLineNo">153</span>      } catch (Exception e) {<a name="line.153"></a>
-<span class="sourceLineNo">154</span>         throw new ServletException(e);<a name="line.154"></a>
-<span class="sourceLineNo">155</span>      }<a name="line.155"></a>
-<span class="sourceLineNo">156</span>   }<a name="line.156"></a>
-<span class="sourceLineNo">157</span><a name="line.157"></a>
-<span class="sourceLineNo">158</span>   /*<a name="line.158"></a>
-<span class="sourceLineNo">159</span>    * Called from RestServlet after a match has been made but before the guard or method invocation.<a name="line.159"></a>
-<span class="sourceLineNo">160</span>    */<a name="line.160"></a>
-<span class="sourceLineNo">161</span>   final void init(Method javaMethod, ObjectMap properties, Map&lt;String,String&gt; defHeader,<a name="line.161"></a>
-<span class="sourceLineNo">162</span>         Map&lt;String,String&gt; defQuery, Map&lt;String,String&gt; defFormData, String defaultCharset, long maxInput,<a name="line.162"></a>
-<span class="sourceLineNo">163</span>         SerializerGroup mSerializers, ParserGroup mParsers, UrlEncodingParser mUrlEncodingParser,<a name="line.163"></a>
-<span class="sourceLineNo">164</span>         BeanContext beanContext, EncoderGroup encoders, Map&lt;String,Widget&gt; widgets) {<a name="line.164"></a>
-<span class="sourceLineNo">165</span>      this.javaMethod = javaMethod;<a name="line.165"></a>
-<span class="sourceLineNo">166</span>      this.properties = properties;<a name="line.166"></a>
-<span class="sourceLineNo">167</span>      this.urlEncodingParser = mUrlEncodingParser;<a name="line.167"></a>
-<span class="sourceLineNo">168</span>      this.beanSession = beanContext.createSession();<a name="line.168"></a>
-<span class="sourceLineNo">169</span>      this.pathParams<a name="line.169"></a>
-<span class="sourceLineNo">170</span>         .setParser(urlEncodingParser)<a name="line.170"></a>
-<span class="sourceLineNo">171</span>         .setBeanSession(beanSession);<a name="line.171"></a>
-<span class="sourceLineNo">172</span>      this.queryParams<a name="line.172"></a>
-<span class="sourceLineNo">173</span>         .addDefault(defQuery)<a name="line.173"></a>
-<span class="sourceLineNo">174</span>         .setParser(urlEncodingParser)<a name="line.174"></a>
-<span class="sourceLineNo">175</span>         .setBeanSession(beanSession);<a name="line.175"></a>
-<span class="sourceLineNo">176</span>      this.headers<a name="line.176"></a>
-<span class="sourceLineNo">177</span>         .addDefault(defHeader)<a name="line.177"></a>
-<span class="sourceLineNo">178</span>         .addDefault(context.getDefaultRequestHeaders())<a name="line.178"></a>
-<span class="sourceLineNo">179</span>         .setParser(urlEncodingParser)<a name="line.179"></a>
-<span class="sourceLineNo">180</span>         .setBeanSession(beanSession);<a name="line.180"></a>
-<span class="sourceLineNo">181</span>      this.body<a name="line.181"></a>
-<span class="sourceLineNo">182</span>         .setEncoders(encoders)<a name="line.182"></a>
-<span class="sourceLineNo">183</span>         .setParsers(mParsers)<a name="line.183"></a>
-<span class="sourceLineNo">184</span>         .setHeaders(headers)<a name="line.184"></a>
-<span class="sourceLineNo">185</span>         .setBeanSession(beanSession)<a name="line.185"></a>
-<span class="sourceLineNo">186</span>         .setUrlEncodingParser(mUrlEncodingParser)<a name="line.186"></a>
+<span class="sourceLineNo">118</span><a name="line.118"></a>
+<span class="sourceLineNo">119</span>         // Get the HTTP method.<a name="line.119"></a>
+<span class="sourceLineNo">120</span>         // Can be overridden through a "method" GET attribute.<a name="line.120"></a>
+<span class="sourceLineNo">121</span>         String _method = super.getMethod();<a name="line.121"></a>
+<span class="sourceLineNo">122</span><a name="line.122"></a>
+<span class="sourceLineNo">123</span>         String m = getQuery().getString("method");<a name="line.123"></a>
+<span class="sourceLineNo">124</span>         if (context.allowMethodParam(m))<a name="line.124"></a>
+<span class="sourceLineNo">125</span>            _method = m;<a name="line.125"></a>
+<span class="sourceLineNo">126</span><a name="line.126"></a>
+<span class="sourceLineNo">127</span>         method = _method;<a name="line.127"></a>
+<span class="sourceLineNo">128</span><a name="line.128"></a>
+<span class="sourceLineNo">129</span>         headers = new RequestHeaders();<a name="line.129"></a>
+<span class="sourceLineNo">130</span>         for (Enumeration&lt;String&gt; e = getHeaderNames(); e.hasMoreElements();) {<a name="line.130"></a>
+<span class="sourceLineNo">131</span>            String name = e.nextElement();<a name="line.131"></a>
+<span class="sourceLineNo">132</span>            headers.put(name, super.getHeaders(name));<a name="line.132"></a>
+<span class="sourceLineNo">133</span>         }<a name="line.133"></a>
+<span class="sourceLineNo">134</span><a name="line.134"></a>
+<span class="sourceLineNo">135</span>         body = new RequestBody(this);<a name="line.135"></a>
+<span class="sourceLineNo">136</span><a name="line.136"></a>
+<span class="sourceLineNo">137</span>         if (context.isAllowBodyParam()) {<a name="line.137"></a>
+<span class="sourceLineNo">138</span>            String b = getQuery().getString("body");<a name="line.138"></a>
+<span class="sourceLineNo">139</span>            if (b != null) {<a name="line.139"></a>
+<span class="sourceLineNo">140</span>               headers.put("Content-Type", UonSerializer.DEFAULT.getResponseContentType());<a name="line.140"></a>
+<span class="sourceLineNo">141</span>               body.load(b.getBytes(UTF8));<a name="line.141"></a>
+<span class="sourceLineNo">142</span>            }<a name="line.142"></a>
+<span class="sourceLineNo">143</span>         }<a name="line.143"></a>
+<span class="sourceLineNo">144</span><a name="line.144"></a>
+<span class="sourceLineNo">145</span>         if (context.isAllowHeaderParams())<a name="line.145"></a>
+<span class="sourceLineNo">146</span>            headers.setQueryParams(queryParams);<a name="line.146"></a>
+<span class="sourceLineNo">147</span><a name="line.147"></a>
+<span class="sourceLineNo">148</span>         debug = "true".equals(getQuery().getString("debug", "false")) || "true".equals(getHeaders().getString("Debug", "false"));<a name="line.148"></a>
+<span class="sourceLineNo">149</span><a name="line.149"></a>
+<span class="sourceLineNo">150</span>         this.pathParams = new RequestPathMatch();<a name="line.150"></a>
+<span class="sourceLineNo">151</span><a name="line.151"></a>
+<span class="sourceLineNo">152</span>      } catch (RestException e) {<a name="line.152"></a>
+<span class="sourceLineNo">153</span>         throw e;<a name="line.153"></a>
+<span class="sourceLineNo">154</span>      } catch (Exception e) {<a name="line.154"></a>
+<span class="sourceLineNo">155</span>         throw new ServletException(e);<a name="line.155"></a>
+<span class="sourceLineNo">156</span>      }<a name="line.156"></a>
+<span class="sourceLineNo">157</span>   }<a name="line.157"></a>
+<span class="sourceLineNo">158</span><a name="line.158"></a>
+<span class="sourceLineNo">159</span>   /*<a name="line.159"></a>
+<span class="sourceLineNo">160</span>    * Called from RestServlet after a match has been made but before the guard or method invocation.<a name="line.160"></a>
+<span class="sourceLineNo">161</span>    */<a name="line.161"></a>
+<span class="sourceLineNo">162</span>   final void init(Method javaMethod, ObjectMap properties, Map&lt;String,String&gt; defHeader,<a name="line.162"></a>
+<span class="sourceLineNo">163</span>         Map&lt;String,String&gt; defQuery, Map&lt;String,String&gt; defFormData, String defaultCharset, long maxInput,<a name="line.163"></a>
+<span class="sourceLineNo">164</span>         SerializerGroup mSerializers, ParserGroup mParsers, HttpPartParser mUrlEncodingParser,<a name="line.164"></a>
+<span class="sourceLineNo">165</span>         BeanContext beanContext, EncoderGroup encoders, Map&lt;String,Widget&gt; widgets) {<a name="line.165"></a>
+<span class="sourceLineNo">166</span>      this.javaMethod = javaMethod;<a name="line.166"></a>
+<span class="sourceLineNo">167</span>      this.properties = properties;<a name="line.167"></a>
+<span class="sourceLineNo">168</span>      this.partParser = mUrlEncodingParser;<a name="line.168"></a>
+<span class="sourceLineNo">169</span>      this.beanSession = beanContext.createSession();<a name="line.169"></a>
+<span class="sourceLineNo">170</span>      this.pathParams<a name="line.170"></a>
+<span class="sourceLineNo">171</span>         .setParser(partParser)<a name="line.171"></a>
+<span class="sourceLineNo">172</span>         .setBeanSession(beanSession);<a name="line.172"></a>
+<span class="sourceLineNo">173</span>      this.queryParams<a name="line.173"></a>
+<span class="sourceLineNo">174</span>         .addDefault(defQuery)<a name="line.174"></a>
+<span class="sourceLineNo">175</span>         .setParser(partParser)<a name="line.175"></a>
+<span class="sourceLineNo">176</span>         .setBeanSession(beanSession);<a name="line.176"></a>
+<span class="sourceLineNo">177</span>      this.headers<a name="line.177"></a>
+<span class="sourceLineNo">178</span>         .addDefault(defHeader)<a name="line.178"></a>
+<span class="sourceLineNo">179</span>         .addDefault(context.getDefaultRequestHeaders())<a name="line.179"></a>
+<span class="sourceLineNo">180</span>         .setParser(partParser)<a name="line.180"></a>
+<span class="sourceLineNo">181</span>         .setBeanSession(beanSession);<a name="line.181"></a>
+<span class="sourceLineNo">182</span>      this.body<a name="line.182"></a>
+<span class="sourceLineNo">183</span>         .setEncoders(encoders)<a name="line.183"></a>
+<span class="sourceLineNo">184</span>         .setParsers(mParsers)<a name="line.184"></a>
+<span class="sourceLineNo">185</span>         .setHeaders(headers)<a name="line.185"></a>
+<span class="sourceLineNo">186</span>         .setBeanSession(beanSession)<a name="line.186"></a>
 <span class="sourceLineNo">187</span>         .setMaxInput(maxInput);<a name="line.187"></a>
 <span class="sourceLineNo">188</span>      this.serializerGroup = mSerializers;<a name="line.188"></a>
 <span class="sourceLineNo">189</span>      this.parserGroup = mParsers;<a name="line.189"></a>
@@ -419,609 +419,610 @@
 <span class="sourceLineNo">411</span>      try {<a name="line.411"></a>
 <span class="sourceLineNo">412</span>         if (formData == null) {<a name="line.412"></a>
 <span class="sourceLineNo">413</span>            formData = new RequestFormData();<a name="line.413"></a>
-<span class="sourceLineNo">414</span>            formData.setParser(urlEncodingParser).setBeanSession(beanSession);<a name="line.414"></a>
+<span class="sourceLineNo">414</span>            formData.setParser(partParser).setBeanSession(beanSession);<a name="line.414"></a>
 <span class="sourceLineNo">415</span>            if (! body.isLoaded()) {<a name="line.415"></a>
 <span class="sourceLineNo">416</span>               formData.putAll(getParameterMap());<a name="line.416"></a>
 <span class="sourceLineNo">417</span>            } else {<a name="line.417"></a>
-<span class="sourceLineNo">418</span>               Map&lt;String,String&gt; m = urlEncodingParser.parse(body.getReader(), Map.class, String.class, String.class);<a name="line.418"></a>
-<span class="sourceLineNo">419</span>               for (Map.Entry&lt;String,String&gt; e : m.entrySet()) {<a name="line.419"></a>
-<span class="sourceLineNo">420</span>                  formData.put(e.getKey(), e.getValue());<a name="line.420"></a>
-<span class="sourceLineNo">421</span>               }<a name="line.421"></a>
-<span class="sourceLineNo">422</span>            }<a name="line.422"></a>
-<span class="sourceLineNo">423</span>         }<a name="line.423"></a>
-<span class="sourceLineNo">424</span>         formData.addDefault(defFormData);<a name="line.424"></a>
-<span class="sourceLineNo">425</span>         return formData;<a name="line.425"></a>
-<span class="sourceLineNo">426</span>      } catch (Exception e) {<a name="line.426"></a>
-<span class="sourceLineNo">427</span>         throw new RestException(SC_INTERNAL_SERVER_ERROR, e);<a name="line.427"></a>
-<span class="sourceLineNo">428</span>      }<a name="line.428"></a>
-<span class="sourceLineNo">429</span>   }<a name="line.429"></a>
-<span class="sourceLineNo">430</span><a name="line.430"></a>
-<span class="sourceLineNo">431</span>   /**<a name="line.431"></a>
-<span class="sourceLineNo">432</span>    * Shortcut for calling &lt;code&gt;getFormData().getString(name)&lt;/code&gt;.<a name="line.432"></a>
-<span class="sourceLineNo">433</span>    *<a name="line.433"></a>
-<span class="sourceLineNo">434</span>    * @param name The form data parameter name.<a name="line.434"></a>
-<span class="sourceLineNo">435</span>    * @return The form data parameter value, or &lt;jk&gt;null&lt;jk&gt; if not found.<a name="line.435"></a>
-<span class="sourceLineNo">436</span>    */<a name="line.436"></a>
-<span class="sourceLineNo">437</span>   public String getFormData(String name) {<a name="line.437"></a>
-<span class="sourceLineNo">438</span>      return getFormData().getString(name);<a name="line.438"></a>
-<span class="sourceLineNo">439</span>   }<a name="line.439"></a>
-<span class="sourceLineNo">440</span><a name="line.440"></a>
+<span class="sourceLineNo">418</span>               Map&lt;String,String[]&gt; m = RestUtils.parseQuery(body.getReader());<a name="line.418"></a>
+<span class="sourceLineNo">419</span>               for (Map.Entry&lt;String,String[]&gt; e : m.entrySet()) {<a name="line.419"></a>
+<span class="sourceLineNo">420</span>                  for (String v : e.getValue())<a name="line.420"></a>
+<span class="sourceLineNo">421</span>                     formData.put(e.getKey(), v);<a name="line.421"></a>
+<span class="sourceLineNo">422</span>               }<a name="line.422"></a>
+<span class="sourceLineNo">423</span>            }<a name="line.423"></a>
+<span class="sourceLineNo">424</span>         }<a name="line.424"></a>
+<span class="sourceLineNo">425</span>         formData.addDefault(defFormData);<a name="line.425"></a>
+<span class="sourceLineNo">426</span>         return formData;<a name="line.426"></a>
+<span class="sourceLineNo">427</span>      } catch (Exception e) {<a name="line.427"></a>
+<span class="sourceLineNo">428</span>         throw new RestException(SC_INTERNAL_SERVER_ERROR, e);<a name="line.428"></a>
+<span class="sourceLineNo">429</span>      }<a name="line.429"></a>
+<span class="sourceLineNo">430</span>   }<a name="line.430"></a>
+<span class="sourceLineNo">431</span><a name="line.431"></a>
+<span class="sourceLineNo">432</span>   /**<a name="line.432"></a>
+<span class="sourceLineNo">433</span>    * Shortcut for calling &lt;code&gt;getFormData().getString(name)&lt;/code&gt;.<a name="line.433"></a>
+<span class="sourceLineNo">434</span>    *<a name="line.434"></a>
+<span class="sourceLineNo">435</span>    * @param name The form data parameter name.<a name="line.435"></a>
+<span class="sourceLineNo">436</span>    * @return The form data parameter value, or &lt;jk&gt;null&lt;jk&gt; if not found.<a name="line.436"></a>
+<span class="sourceLineNo">437</span>    */<a name="line.437"></a>
+<span class="sourceLineNo">438</span>   public String getFormData(String name) {<a name="line.438"></a>
+<span class="sourceLineNo">439</span>      return getFormData().getString(name);<a name="line.439"></a>
+<span class="sourceLineNo">440</span>   }<a name="line.440"></a>
 <span class="sourceLineNo">441</span><a name="line.441"></a>
-<span class="sourceLineNo">442</span>   //--------------------------------------------------------------------------------<a name="line.442"></a>
-<span class="sourceLineNo">443</span>   // Path parameters<a name="line.443"></a>
-<span class="sourceLineNo">444</span>   //--------------------------------------------------------------------------------<a name="line.444"></a>
-<span class="sourceLineNo">445</span><a name="line.445"></a>
-<span class="sourceLineNo">446</span>   /**<a name="line.446"></a>
-<span class="sourceLineNo">447</span>    * Retrieves the URL-encoded form data from the request if the body has already been cached locally.<a name="line.447"></a>
-<span class="sourceLineNo">448</span>    *<a name="line.448"></a>
-<span class="sourceLineNo">449</span>    * @return The URL-encoded form data from the request.<a name="line.449"></a>
-<span class="sourceLineNo">450</span>    */<a name="line.450"></a>
-<span class="sourceLineNo">451</span>   public RequestPathMatch getPathMatch() {<a name="line.451"></a>
-<span class="sourceLineNo">452</span>      return pathParams;<a name="line.452"></a>
-<span class="sourceLineNo">453</span>   }<a name="line.453"></a>
-<span class="sourceLineNo">454</span><a name="line.454"></a>
-<span class="sourceLineNo">455</span>   /**<a name="line.455"></a>
-<span class="sourceLineNo">456</span>    * Shortcut for calling &lt;code&gt;getPathMatch().get(name)&lt;/code&gt;.<a name="line.456"></a>
-<span class="sourceLineNo">457</span>    *<a name="line.457"></a>
-<span class="sourceLineNo">458</span>    * @param name The path variable name.<a name="line.458"></a>
-<span class="sourceLineNo">459</span>    * @return The path variable value, or &lt;jk&gt;null&lt;jk&gt; if not found.<a name="line.459"></a>
-<span class="sourceLineNo">460</span>    */<a name="line.460"></a>
-<span class="sourceLineNo">461</span>   public String getPath(String name) {<a name="line.461"></a>
-<span class="sourceLineNo">462</span>      return getPathMatch().get(name);<a name="line.462"></a>
-<span class="sourceLineNo">463</span>   }<a name="line.463"></a>
-<span class="sourceLineNo">464</span><a name="line.464"></a>
-<span class="sourceLineNo">465</span>   //--------------------------------------------------------------------------------<a name="line.465"></a>
-<span class="sourceLineNo">466</span>   // Body methods<a name="line.466"></a>
-<span class="sourceLineNo">467</span>   //--------------------------------------------------------------------------------<a name="line.467"></a>
-<span class="sourceLineNo">468</span><a name="line.468"></a>
-<span class="sourceLineNo">469</span>   /**<a name="line.469"></a>
-<span class="sourceLineNo">470</span>    * Returns the body of this HTTP request.<a name="line.470"></a>
-<span class="sourceLineNo">471</span>    *<a name="line.471"></a>
-<span class="sourceLineNo">472</span>    * @return The body of this HTTP request.<a name="line.472"></a>
-<span class="sourceLineNo">473</span>    */<a name="line.473"></a>
-<span class="sourceLineNo">474</span>   public RequestBody getBody() {<a name="line.474"></a>
-<span class="sourceLineNo">475</span>      return body;<a name="line.475"></a>
-<span class="sourceLineNo">476</span>   }<a name="line.476"></a>
-<span class="sourceLineNo">477</span><a name="line.477"></a>
-<span class="sourceLineNo">478</span>   /**<a name="line.478"></a>
-<span class="sourceLineNo">479</span>    * Returns the HTTP body content as a {@link Reader}.<a name="line.479"></a>
-<span class="sourceLineNo">480</span>    *<a name="line.480"></a>
-<span class="sourceLineNo">481</span>    * &lt;p&gt;<a name="line.481"></a>
-<span class="sourceLineNo">482</span>    * If {@code allowHeaderParams} init parameter is true, then first looks for {@code &amp;body=xxx} in the URL query<a name="line.482"></a>
-<span class="sourceLineNo">483</span>    * string.<a name="line.483"></a>
-<span class="sourceLineNo">484</span>    *<a name="line.484"></a>
-<span class="sourceLineNo">485</span>    * &lt;p&gt;<a name="line.485"></a>
-<span class="sourceLineNo">486</span>    * Automatically handles GZipped input streams.<a name="line.486"></a>
-<span class="sourceLineNo">487</span>    */<a name="line.487"></a>
-<span class="sourceLineNo">488</span>   @Override /* ServletRequest */<a name="line.488"></a>
-<span class="sourceLineNo">489</span>   public BufferedReader getReader() throws IOException {<a name="line.489"></a>
-<span class="sourceLineNo">490</span>      return getBody().getReader();<a name="line.490"></a>
-<span class="sourceLineNo">491</span>   }<a name="line.491"></a>
-<span class="sourceLineNo">492</span><a name="line.492"></a>
-<span class="sourceLineNo">493</span>   /**<a name="line.493"></a>
-<span class="sourceLineNo">494</span>    * Returns the HTTP body content as an {@link InputStream}.<a name="line.494"></a>
-<span class="sourceLineNo">495</span>    *<a name="line.495"></a>
-<span class="sourceLineNo">496</span>    * &lt;p&gt;<a name="line.496"></a>
-<span class="sourceLineNo">497</span>    * Automatically handles GZipped input streams.<a name="line.497"></a>
-<span class="sourceLineNo">498</span>    *<a name="line.498"></a>
-<span class="sourceLineNo">499</span>    * @return The negotiated input stream.<a name="line.499"></a>
-<span class="sourceLineNo">500</span>    * @throws IOException If any error occurred while trying to get the input stream or wrap it in the GZIP wrapper.<a name="line.500"></a>
-<span class="sourceLineNo">501</span>    */<a name="line.501"></a>
-<span class="sourceLineNo">502</span>   @Override /* ServletRequest */<a name="line.502"></a>
-<span class="sourceLineNo">503</span>   public ServletInputStream getInputStream() throws IOException {<a name="line.503"></a>
-<span class="sourceLineNo">504</span>      return getBody().getInputStream();<a name="line.504"></a>
-<span class="sourceLineNo">505</span>   }<a name="line.505"></a>
-<span class="sourceLineNo">506</span><a name="line.506"></a>
-<span class="sourceLineNo">507</span>   ServletInputStream getRawInputStream() throws IOException {<a name="line.507"></a>
-<span class="sourceLineNo">508</span>      return super.getInputStream();<a name="line.508"></a>
-<span class="sourceLineNo">509</span>   }<a name="line.509"></a>
-<span class="sourceLineNo">510</span><a name="line.510"></a>
+<span class="sourceLineNo">442</span><a name="line.442"></a>
+<span class="sourceLineNo">443</span>   //--------------------------------------------------------------------------------<a name="line.443"></a>
+<span class="sourceLineNo">444</span>   // Path parameters<a name="line.444"></a>
+<span class="sourceLineNo">445</span>   //--------------------------------------------------------------------------------<a name="line.445"></a>
+<span class="sourceLineNo">446</span><a name="line.446"></a>
+<span class="sourceLineNo">447</span>   /**<a name="line.447"></a>
+<span class="sourceLineNo">448</span>    * Retrieves the URL-encoded form data from the request if the body has already been cached locally.<a name="line.448"></a>
+<span class="sourceLineNo">449</span>    *<a name="line.449"></a>
+<span class="sourceLineNo">450</span>    * @return The URL-encoded form data from the request.<a name="line.450"></a>
+<span class="sourceLineNo">451</span>    */<a name="line.451"></a>
+<span class="sourceLineNo">452</span>   public RequestPathMatch getPathMatch() {<a name="line.452"></a>
+<span class="sourceLineNo">453</span>      return pathParams;<a name="line.453"></a>
+<span class="sourceLineNo">454</span>   }<a name="line.454"></a>
+<span class="sourceLineNo">455</span><a name="line.455"></a>
+<span class="sourceLineNo">456</span>   /**<a name="line.456"></a>
+<span class="sourceLineNo">457</span>    * Shortcut for calling &lt;code&gt;getPathMatch().get(name)&lt;/code&gt;.<a name="line.457"></a>
+<span class="sourceLineNo">458</span>    *<a name="line.458"></a>
+<span class="sourceLineNo">459</span>    * @param name The path variable name.<a name="line.459"></a>
+<span class="sourceLineNo">460</span>    * @return The path variable value, or &lt;jk&gt;null&lt;jk&gt; if not found.<a name="line.460"></a>
+<span class="sourceLineNo">461</span>    */<a name="line.461"></a>
+<span class="sourceLineNo">462</span>   public String getPath(String name) {<a name="line.462"></a>
+<span class="sourceLineNo">463</span>      return getPathMatch().get(name);<a name="line.463"></a>
+<span class="sourceLineNo">464</span>   }<a name="line.464"></a>
+<span class="sourceLineNo">465</span><a name="line.465"></a>
+<span class="sourceLineNo">466</span>   //--------------------------------------------------------------------------------<a name="line.466"></a>
+<span class="sourceLineNo">467</span>   // Body methods<a name="line.467"></a>
+<span class="sourceLineNo">468</span>   //--------------------------------------------------------------------------------<a name="line.468"></a>
+<span class="sourceLineNo">469</span><a name="line.469"></a>
+<span class="sourceLineNo">470</span>   /**<a name="line.470"></a>
+<span class="sourceLineNo">471</span>    * Returns the body of this HTTP request.<a name="line.471"></a>
+<span class="sourceLineNo">472</span>    *<a name="line.472"></a>
+<span class="sourceLineNo">473</span>    * @return The body of this HTTP request.<a name="line.473"></a>
+<span class="sourceLineNo">474</span>    */<a name="line.474"></a>
+<span class="sourceLineNo">475</span>   public RequestBody getBody() {<a name="line.475"></a>
+<span class="sourceLineNo">476</span>      return body;<a name="line.476"></a>
+<span class="sourceLineNo">477</span>   }<a name="line.477"></a>
+<span class="sourceLineNo">478</span><a name="line.478"></a>
+<span class="sourceLineNo">479</span>   /**<a name="line.479"></a>
+<span class="sourceLineNo">480</span>    * Returns the HTTP body content as a {@link Reader}.<a name="line.480"></a>
+<span class="sourceLineNo">481</span>    *<a name="line.481"></a>
+<span class="sourceLineNo">482</span>    * &lt;p&gt;<a name="line.482"></a>
+<span class="sourceLineNo">483</span>    * If {@code allowHeaderParams} init parameter is true, then first looks for {@code &amp;body=xxx} in the URL query<a name="line.483"></a>
+<span class="sourceLineNo">484</span>    * string.<a name="line.484"></a>
+<span class="sourceLineNo">485</span>    *<a name="line.485"></a>
+<span class="sourceLineNo">486</span>    * &lt;p&gt;<a name="line.486"></a>
+<span class="sourceLineNo">487</span>    * Automatically handles GZipped input streams.<a name="line.487"></a>
+<span class="sourceLineNo">488</span>    */<a name="line.488"></a>
+<span class="sourceLineNo">489</span>   @Override /* ServletRequest */<a name="line.489"></a>
+<span class="sourceLineNo">490</span>   public BufferedReader getReader() throws IOException {<a name="line.490"></a>
+<span class="sourceLineNo">491</span>      return getBody().getReader();<a name="line.491"></a>
+<span class="sourceLineNo">492</span>   }<a name="line.492"></a>
+<span class="sourceLineNo">493</span><a name="line.493"></a>
+<span class="sourceLineNo">494</span>   /**<a name="line.494"></a>
+<span class="sourceLineNo">495</span>    * Returns the HTTP body content as an {@link InputStream}.<a name="line.495"></a>
+<span class="sourceLineNo">496</span>    *<a name="line.496"></a>
+<span class="sourceLineNo">497</span>    * &lt;p&gt;<a name="line.497"></a>
+<span class="sourceLineNo">498</span>    * Automatically handles GZipped input streams.<a name="line.498"></a>
+<span class="sourceLineNo">499</span>    *<a name="line.499"></a>
+<span class="sourceLineNo">500</span>    * @return The negotiated input stream.<a name="line.500"></a>
+<span class="sourceLineNo">501</span>    * @throws IOException If any error occurred while trying to get the input stream or wrap it in the GZIP wrapper.<a name="line.501"></a>
+<span class="sourceLineNo">502</span>    */<a name="line.502"></a>
+<span class="sourceLineNo">503</span>   @Override /* ServletRequest */<a name="line.503"></a>
+<span class="sourceLineNo">504</span>   public ServletInputStream getInputStream() throws IOException {<a name="line.504"></a>
+<span class="sourceLineNo">505</span>      return getBody().getInputStream();<a name="line.505"></a>
+<span class="sourceLineNo">506</span>   }<a name="line.506"></a>
+<span class="sourceLineNo">507</span><a name="line.507"></a>
+<span class="sourceLineNo">508</span>   ServletInputStream getRawInputStream() throws IOException {<a name="line.508"></a>
+<span class="sourceLineNo">509</span>      return super.getInputStream();<a name="line.509"></a>
+<span class="sourceLineNo">510</span>   }<a name="line.510"></a>
 <span class="sourceLineNo">511</span><a name="line.511"></a>
-<span class="sourceLineNo">512</span>   //--------------------------------------------------------------------------------<a name="line.512"></a>
-<span class="sourceLineNo">513</span>   // URI-related methods<a name="line.513"></a>
-<span class="sourceLineNo">514</span>   //--------------------------------------------------------------------------------<a name="line.514"></a>
-<span class="sourceLineNo">515</span><a name="line.515"></a>
-<span class="sourceLineNo">516</span>   @Override /* HttpServletRequest */<a name="line.516"></a>
-<span class="sourceLineNo">517</span>   public String getContextPath() {<a name="line.517"></a>
-<span class="sourceLineNo">518</span>      String cp = context.getContextPath();<a name="line.518"></a>
-<span class="sourceLineNo">519</span>      return cp == null ? super.getContextPath() : cp;<a name="line.519"></a>
-<span class="sourceLineNo">520</span>   }<a name="line.520"></a>
-<span class="sourceLineNo">521</span><a name="line.521"></a>
-<span class="sourceLineNo">522</span>   @Override /* HttpServletRequest */<a name="line.522"></a>
-<span class="sourceLineNo">523</span>   public String getServletPath() {<a name="line.523"></a>
-<span class="sourceLineNo">524</span>      String cp = context.getContextPath();<a name="line.524"></a>
-<span class="sourceLineNo">525</span>      String sp = super.getServletPath();<a name="line.525"></a>
-<span class="sourceLineNo">526</span>      return cp == null || ! sp.startsWith(cp) ? sp : sp.substring(cp.length());<a name="line.526"></a>
-<span class="sourceLineNo">527</span>   }<a name="line.527"></a>
-<span class="sourceLineNo">528</span><a name="line.528"></a>
-<span class="sourceLineNo">529</span>   /**<a name="line.529"></a>
-<span class="sourceLineNo">530</span>    * Returns the URI context of the request.<a name="line.530"></a>
-<span class="sourceLineNo">531</span>    *<a name="line.531"></a>
-<span class="sourceLineNo">532</span>    * &lt;p&gt;<a name="line.532"></a>
-<span class="sourceLineNo">533</span>    * The URI context contains all the information about the URI of the request, such as the servlet URI, context<a name="line.533"></a>
-<span class="sourceLineNo">534</span>    * path, etc...<a name="line.534"></a>
-<span class="sourceLineNo">535</span>    *<a name="line.535"></a>
-<span class="sourceLineNo">536</span>    * @return The URI context of the request.<a name="line.536"></a>
-<span class="sourceLineNo">537</span>    */<a name="line.537"></a>
-<span class="sourceLineNo">538</span>   public UriContext getUriContext() {<a name="line.538"></a>
-<span class="sourceLineNo">539</span>      if (uriContext == null) {<a name="line.539"></a>
-<span class="sourceLineNo">540</span>         String scheme = getScheme();<a name="line.540"></a>
-<span class="sourceLineNo">541</span>         int port = getServerPort();<a name="line.541"></a>
-<span class="sourceLineNo">542</span>         StringBuilder authority = new StringBuilder(getScheme()).append("://").append(getServerName());<a name="line.542"></a>
-<span class="sourceLineNo">543</span>         if (! (port == 80 &amp;&amp; "http".equals(scheme) || port == 443 &amp;&amp; "https".equals(scheme)))<a name="line.543"></a>
-<span class="sourceLineNo">544</span>            authority.append(':').append(port);<a name="line.544"></a>
-<span class="sourceLineNo">545</span>         uriContext = new UriContext(authority.toString(), getContextPath(), getServletPath(), super.getPathInfo());<a name="line.545"></a>
-<span class="sourceLineNo">546</span>      }<a name="line.546"></a>
-<span class="sourceLineNo">547</span>      return uriContext;<a name="line.547"></a>
-<span class="sourceLineNo">548</span>   }<a name="line.548"></a>
-<span class="sourceLineNo">549</span><a name="line.549"></a>
-<span class="sourceLineNo">550</span>   /**<a name="line.550"></a>
-<span class="sourceLineNo">551</span>    * Returns a URI resolver that can be used to convert URIs to absolute or root-relative form.<a name="line.551"></a>
-<span class="sourceLineNo">552</span>    *<a name="line.552"></a>
-<span class="sourceLineNo">553</span>    * @param resolution The URI resolution rule.<a name="line.553"></a>
-<span class="sourceLineNo">554</span>    * @param relativity The relative URI relativity rule.<a name="line.554"></a>
-<span class="sourceLineNo">555</span>    * @return The URI resolver for this request.<a name="line.555"></a>
-<span class="sourceLineNo">556</span>    */<a name="line.556"></a>
-<span class="sourceLineNo">557</span>   public UriResolver getUriResolver(UriResolution resolution, UriRelativity relativity) {<a name="line.557"></a>
-<span class="sourceLineNo">558</span>      return new UriResolver(resolution, relativity, getUriContext());<a name="line.558"></a>
-<span class="sourceLineNo">559</span>   }<a name="line.559"></a>
-<span class="sourceLineNo">560</span><a name="line.560"></a>
-<span class="sourceLineNo">561</span>   /**<a name="line.561"></a>
-<span class="sourceLineNo">562</span>    * Shortcut for calling {@link #getUriResolver()} using {@link UriResolution#ROOT_RELATIVE} and<a name="line.562"></a>
-<span class="sourceLineNo">563</span>    * {@link UriRelativity#RESOURCE}<a name="line.563"></a>
-<span class="sourceLineNo">564</span>    *<a name="line.564"></a>
-<span class="sourceLineNo">565</span>    * @return The URI resolver for this request.<a name="line.565"></a>
-<span class="sourceLineNo">566</span>    */<a name="line.566"></a>
-<span class="sourceLineNo">567</span>   public UriResolver getUriResolver() {<a name="line.567"></a>
-<span class="sourceLineNo">568</span>      return new UriResolver(UriResolution.ROOT_RELATIVE, UriRelativity.RESOURCE, getUriContext());<a name="line.568"></a>
-<span class="sourceLineNo">569</span>   }<a name="line.569"></a>
-<span class="sourceLineNo">570</span><a name="line.570"></a>
-<span class="sourceLineNo">571</span>   /**<a name="line.571"></a>
-<span class="sourceLineNo">572</span>    * Returns the URI for this request.<a name="line.572"></a>
-<span class="sourceLineNo">573</span>    *<a name="line.573"></a>
-<span class="sourceLineNo">574</span>    * &lt;p&gt;<a name="line.574"></a>
-<span class="sourceLineNo">575</span>    * Similar to {@link #getRequestURI()} but returns the value as a {@link URI}.<a name="line.575"></a>
-<span class="sourceLineNo">576</span>    * It also gives you the capability to override the query parameters (e.g. add new query parameters to the existing<a name="line.576"></a>
-<span class="sourceLineNo">577</span>    * URI).<a name="line.577"></a>
-<span class="sourceLineNo">578</span>    *<a name="line.578"></a>
-<span class="sourceLineNo">579</span>    * @param includeQuery If &lt;jk&gt;true&lt;/jk&gt; include the query parameters on the request.<a name="line.579"></a>
-<span class="sourceLineNo">580</span>    * @param addQueryParams Augment the request URI with the specified query parameters.<a name="line.580"></a>
-<span class="sourceLineNo">581</span>    * @return A new URI.<a name="line.581"></a>
-<span class="sourceLineNo">582</span>    */<a name="line.582"></a>
-<span class="sourceLineNo">583</span>   public URI getUri(boolean includeQuery, Map&lt;String,?&gt; addQueryParams) {<a name="line.583"></a>
-<span class="sourceLineNo">584</span>      String uri = getRequestURI();<a name="line.584"></a>
-<span class="sourceLineNo">585</span>      if (includeQuery || addQueryParams != null) {<a name="line.585"></a>
-<span class="sourceLineNo">586</span>         StringBuilder sb = new StringBuilder(uri);<a name="line.586"></a>
-<span class="sourceLineNo">587</span>         RequestQuery rq = this.queryParams.copy();<a name="line.587"></a>
-<span class="sourceLineNo">588</span>         if (addQueryParams != null)<a name="line.588"></a>
-<span class="sourceLineNo">589</span>            for (Map.Entry&lt;String,?&gt; e : addQueryParams.entrySet())<a name="line.589"></a>
-<span class="sourceLineNo">590</span>               rq.put(e.getKey(), e.getValue());<a name="line.590"></a>
-<span class="sourceLineNo">591</span>         if (! rq.isEmpty())<a name="line.591"></a>
-<span class="sourceLineNo">592</span>            sb.append('?').append(rq.toQueryString());<a name="line.592"></a>
-<span class="sourceLineNo">593</span>         uri = sb.toString();<a name="line.593"></a>
-<span class="sourceLineNo">594</span>      }<a name="line.594"></a>
-<span class="sourceLineNo">595</span>      try {<a name="line.595"></a>
-<span class="sourceLineNo">596</span>         return new URI(uri);<a name="line.596"></a>
-<span class="sourceLineNo">597</span>      } catch (URISyntaxException e) {<a name="line.597"></a>
-<span class="sourceLineNo">598</span>         // Shouldn't happen.<a name="line.598"></a>
-<span class="sourceLineNo">599</span>         throw new RuntimeException(e);<a name="line.599"></a>
-<span class="sourceLineNo">600</span>      }<a name="line.600"></a>
-<span class="sourceLineNo">601</span>   }<a name="line.601"></a>
-<span class="sourceLineNo">602</span><a name="line.602"></a>
-<span class="sourceLineNo">603</span>   //--------------------------------------------------------------------------------<a name="line.603"></a>
-<span class="sourceLineNo">604</span>   // Labels<a name="line.604"></a>
-<span class="sourceLineNo">605</span>   //--------------------------------------------------------------------------------<a name="line.605"></a>
-<span class="sourceLineNo">606</span><a name="line.606"></a>
-<span class="sourceLineNo">607</span>   /**<a name="line.607"></a>
-<span class="sourceLineNo">608</span>    * Returns the info provider on the servlet.<a name="line.608"></a>
-<span class="sourceLineNo">609</span>    * <a name="line.609"></a>
-<span class="sourceLineNo">610</span>    * @return The info provider on the servlet.<a name="line.610"></a>
-<span class="sourceLineNo">611</span>    */<a name="line.611"></a>
-<span class="sourceLineNo">612</span>   public RestInfoProvider getInfoProvider() {<a name="line.612"></a>
-<span class="sourceLineNo">613</span>      return context.getInfoProvider();<a name="line.613"></a>
-<span class="sourceLineNo">614</span>   }<a name="line.614"></a>
-<span class="sourceLineNo">615</span>   <a name="line.615"></a>
-<span class="sourceLineNo">616</span>   /**<a name="line.616"></a>
-<span class="sourceLineNo">617</span>    * Returns the localized site name.<a name="line.617"></a>
-<span class="sourceLineNo">618</span>    *<a name="line.618"></a>
-<span class="sourceLineNo">619</span>    * &lt;p&gt;<a name="line.619"></a>
-<span class="sourceLineNo">620</span>    * The site name is intended to be a title that can be applied to the entire site.<a name="line.620"></a>
-<span class="sourceLineNo">621</span>    *<a name="line.621"></a>
-<span class="sourceLineNo">622</span>    * &lt;p&gt;<a name="line.622"></a>
-<span class="sourceLineNo">623</span>    * One possible use is if you want to add the same title to the top of all pages by defining a header on a<a name="line.623"></a>
-<span class="sourceLineNo">624</span>    * common parent class like so:<a name="line.624"></a>
-<span class="sourceLineNo">625</span>    * &lt;p class='bcode'&gt;<a name="line.625"></a>
-<span class="sourceLineNo">626</span>    *    htmldoc=&lt;ja&gt;@HtmlDoc&lt;/ja&gt;(<a name="line.626"></a>
-<span class="sourceLineNo">627</span>    *       header={<a name="line.627"></a>
-<span class="sourceLineNo">628</span>    *          &lt;js&gt;"&amp;lt;h1&amp;gt;$R{siteName}&amp;lt;/h1&amp;gt;"&lt;/js&gt;,<a name="line.628"></a>
-<span class="sourceLineNo">629</span>    *          &lt;js&gt;"&amp;lt;h2&amp;gt;$R{servletTitle}&amp;lt;/h2&amp;gt;"&lt;/js&gt;<a name="line.629"></a>
-<span class="sourceLineNo">630</span>    *       }<a name="line.630"></a>
-<span class="sourceLineNo">631</span>    *    )<a name="line.631"></a>
-<span class="sourceLineNo">632</span>    * &lt;/p&gt;<a name="line.632"></a>
-<span class="sourceLineNo">633</span>    *<a name="line.633"></a>
-<span class="sourceLineNo">634</span>    * &lt;p&gt;<a name="line.634"></a>
-<span class="sourceLineNo">635</span>    * Equivalent to calling {@link RestInfoProvider#getSiteName(RestRequest)} with this object.<a name="line.635"></a>
-<span class="sourceLineNo">636</span>    *<a name="line.636"></a>
-<span class="sourceLineNo">637</span>    * @return The localized servlet label.<a name="line.637"></a>
-<span class="sourceLineNo">638</span>    */<a name="line.638"></a>
-<span class="sourceLineNo">639</span>   public String getSiteName() {<a name="line.639"></a>
-<span class="sourceLineNo">640</span>      return context.getInfoProvider().getSiteName(this);<a name="line.640"></a>
-<span class="sourceLineNo">641</span>   }<a name="line.641"></a>
-<span class="sourceLineNo">642</span><a name="line.642"></a>
-<span class="sourceLineNo">643</span>   /**<a name="line.643"></a>
-<span class="sourceLineNo">644</span>    * Returns the localized servlet title.<a name="line.644"></a>
-<span class="sourceLineNo">645</span>    *<a name="line.645"></a>
-<span class="sourceLineNo">646</span>    * &lt;p&gt;<a name="line.646"></a>
-<span class="sourceLineNo">647</span>    * Equivalent to calling {@link RestInfoProvider#getTitle(RestRequest)} with this object.<a name="line.647"></a>
-<span class="sourceLineNo">648</span>    *<a name="line.648"></a>
-<span class="sourceLineNo">649</span>    * @return The localized servlet label.<a name="line.649"></a>
-<span class="sourceLineNo">650</span>    */<a name="line.650"></a>
-<span class="sourceLineNo">651</span>   public String getServletTitle() {<a name="line.651"></a>
-<span class="sourceLineNo">652</span>      return context.getInfoProvider().getTitle(this);<a name="line.652"></a>
-<span class="sourceLineNo">653</span>   }<a name="line.653"></a>
-<span class="sourceLineNo">654</span><a name="line.654"></a>
-<span class="sourceLineNo">655</span>   /**<a name="line.655"></a>
-<span class="sourceLineNo">656</span>    * Returns the localized servlet description.<a name="line.656"></a>
-<span class="sourceLineNo">657</span>    *<a name="line.657"></a>
-<span class="sourceLineNo">658</span>    * &lt;p&gt;<a name="line.658"></a>
-<span class="sourceLineNo">659</span>    * Equivalent to calling {@link RestInfoProvider#getDescription(RestRequest)} with this object.<a name="line.659"></a>
-<span class="sourceLineNo">660</span>    *<a name="line.660"></a>
-<span class="sourceLineNo">661</span>    * @return The localized servlet description.<a name="line.661"></a>
-<span class="sourceLineNo">662</span>    */<a name="line.662"></a>
-<span class="sourceLineNo">663</span>   public String getServletDescription() {<a name="line.663"></a>
-<span class="sourceLineNo">664</span>      return context.getInfoProvider().getDescription(this);<a name="line.664"></a>
-<span class="sourceLineNo">665</span>   }<a name="line.665"></a>
-<span class="sourceLineNo">666</span><a name="line.666"></a>
-<span class="sourceLineNo">667</span>   /**<a name="line.667"></a>
-<span class="sourceLineNo">668</span>    * Returns the localized method summary.<a name="line.668"></a>
-<span class="sourceLineNo">669</span>    *<a name="line.669"></a>
-<span class="sourceLineNo">670</span>    * &lt;p&gt;<a name="line.670"></a>
-<span class="sourceLineNo">671</span>    * Equivalent to calling {@link RestInfoProvider#getMethodSummary(String, RestRequest)} with this object.<a name="line.671"></a>
-<span class="sourceLineNo">672</span>    *<a name="line.672"></a>
-<span class="sourceLineNo">673</span>    * @return The localized method description.<a name="line.673"></a>
-<span class="sourceLineNo">674</span>    */<a name="line.674"></a>
-<span class="sourceLineNo">675</span>   public String getMethodSummary() {<a name="line.675"></a>
-<span class="sourceLineNo">676</span>      return context.getInfoProvider().getMethodSummary(javaMethod.getName(), this);<a name="line.676"></a>
-<span class="sourceLineNo">677</span>   }<a name="line.677"></a>
-<span class="sourceLineNo">678</span><a name="line.678"></a>
-<span class="sourceLineNo">679</span>   /**<a name="line.679"></a>
-<span class="sourceLineNo">680</span>    * Returns the localized method description.<a name="line.680"></a>
-<span class="sourceLineNo">681</span>    *<a name="line.681"></a>
-<span class="sourceLineNo">682</span>    * &lt;p&gt;<a name="line.682"></a>
-<span class="sourceLineNo">683</span>    * Equivalent to calling {@link RestInfoProvider#getMethodDescription(String, RestRequest)} with this object.<a name="line.683"></a>
-<span class="sourceLineNo">684</span>    *<a name="line.684"></a>
-<span class="sourceLineNo">685</span>    * @return The localized method description.<a name="line.685"></a>
-<span class="sourceLineNo">686</span>    */<a name="line.686"></a>
-<span class="sourceLineNo">687</span>   public String getMethodDescription() {<a name="line.687"></a>
-<span class="sourceLineNo">688</span>      return context.getInfoProvider().getMethodDescription(javaMethod.getName(), this);<a name="line.688"></a>
-<span class="sourceLineNo">689</span>   }<a name="line.689"></a>
-<span class="sourceLineNo">690</span><a name="line.690"></a>
-<span class="sourceLineNo">691</span>   //--------------------------------------------------------------------------------<a name="line.691"></a>
-<span class="sourceLineNo">692</span>   // Other methods<a name="line.692"></a>
-<span class="sourceLineNo">693</span>   //--------------------------------------------------------------------------------<a name="line.693"></a>
-<span class="sourceLineNo">694</span><a name="line.694"></a>
-<span class="sourceLineNo">695</span>   /**<a name="line.695"></a>
-<span class="sourceLineNo">696</span>    * Returns the serializers associated with this request.<a name="line.696"></a>
-<span class="sourceLineNo">697</span>    *<a name="line.697"></a>
-<span class="sourceLineNo">698</span>    * @return The serializers associated with this request.<a name="line.698"></a>
-<span class="sourceLineNo">699</span>    */<a name="line.699"></a>
-<span class="sourceLineNo">700</span>   public SerializerGroup getSerializerGroup() {<a name="line.700"></a>
-<span class="sourceLineNo">701</span>      return serializerGroup;<a name="line.701"></a>
-<span class="sourceLineNo">702</span>   }<a name="line.702"></a>
-<span class="sourceLineNo">703</span><a name="line.703"></a>
-<span class="sourceLineNo">704</span>   /**<a name="line.704"></a>
-<span class="sourceLineNo">705</span>    * Returns the parsers associated with this request.<a name="line.705"></a>
-<span class="sourceLineNo">706</span>    *<a name="line.706"></a>
-<span class="sourceLineNo">707</span>    * @return The parsers associated with this request.<a name="line.707"></a>
-<span class="sourceLineNo">708</span>    */<a name="line.708"></a>
-<span class="sourceLineNo">709</span>   public ParserGroup getParserGroup() {<a name="line.709"></a>
-<span class="sourceLineNo">710</span>      return parserGroup;<a name="line.710"></a>
-<span class="sourceLineNo">711</span>   }<a name="line.711"></a>
-<span class="sourceLineNo">712</span><a name="line.712"></a>
+<span class="sourceLineNo">512</span><a name="line.512"></a>
+<span class="sourceLineNo">513</span>   //--------------------------------------------------------------------------------<a name="line.513"></a>
+<span class="sourceLineNo">514</span>   // URI-related methods<a name="line.514"></a>
+<span class="sourceLineNo">515</span>   //--------------------------------------------------------------------------------<a name="line.515"></a>
+<span class="sourceLineNo">516</span><a name="line.516"></a>
+<span class="sourceLineNo">517</span>   @Override /* HttpServletRequest */<a name="line.517"></a>
+<span class="sourceLineNo">518</span>   public String getContextPath() {<a name="line.518"></a>
+<span class="sourceLineNo">519</span>      String cp = context.getContextPath();<a name="line.519"></a>
+<span class="sourceLineNo">520</span>      return cp == null ? super.getContextPath() : cp;<a name="line.520"></a>
+<span class="sourceLineNo">521</span>   }<a name="line.521"></a>
+<span class="sourceLineNo">522</span><a name="line.522"></a>
+<span class="sourceLineNo">523</span>   @Override /* HttpServletRequest */<a name="line.523"></a>
+<span class="sourceLineNo">524</span>   public String getServletPath() {<a name="line.524"></a>
+<span class="sourceLineNo">525</span>      String cp = context.getContextPath();<a name="line.525"></a>
+<span class="sourceLineNo">526</span>      String sp = super.getServletPath();<a name="line.526"></a>
+<span class="sourceLineNo">527</span>      return cp == null || ! sp.startsWith(cp) ? sp : sp.substring(cp.length());<a name="line.527"></a>
+<span class="sourceLineNo">528</span>   }<a name="line.528"></a>
+<span class="sourceLineNo">529</span><a name="line.529"></a>
+<span class="sourceLineNo">530</span>   /**<a name="line.530"></a>
+<span class="sourceLineNo">531</span>    * Returns the URI context of the request.<a name="line.531"></a>
+<span class="sourceLineNo">532</span>    *<a name="line.532"></a>
+<span class="sourceLineNo">533</span>    * &lt;p&gt;<a name="line.533"></a>
+<span class="sourceLineNo">534</span>    * The URI context contains all the information about the URI of the request, such as the servlet URI, context<a name="line.534"></a>
+<span class="sourceLineNo">535</span>    * path, etc...<a name="line.535"></a>
+<span class="sourceLineNo">536</span>    *<a name="line.536"></a>
+<span class="sourceLineNo">537</span>    * @return The URI context of the request.<a name="line.537"></a>
+<span class="sourceLineNo">538</span>    */<a name="line.538"></a>
+<span class="sourceLineNo">539</span>   public UriContext getUriContext() {<a name="line.539"></a>
+<span class="sourceLineNo">540</span>      if (uriContext == null) {<a name="line.540"></a>
+<span class="sourceLineNo">541</span>         String scheme = getScheme();<a name="line.541"></a>
+<span class="sourceLineNo">542</span>         int port = getServerPort();<a name="line.542"></a>
+<span class="sourceLineNo">543</span>         StringBuilder authority = new StringBuilder(getScheme()).append("://").append(getServerName());<a name="line.543"></a>
+<span class="sourceLineNo">544</span>         if (! (port == 80 &amp;&amp; "http".equals(scheme) || port == 443 &amp;&amp; "https".equals(scheme)))<a name="line.544"></a>
+<span class="sourceLineNo">545</span>            authority.append(':').append(port);<a name="line.545"></a>
+<span class="sourceLineNo">546</span>         uriContext = new UriContext(authority.toString(), getContextPath(), getServletPath(), super.getPathInfo());<a name="line.546"></a>
+<span class="sourceLineNo">547</span>      }<a name="line.547"></a>
+<span class="sourceLineNo">548</span>      return uriContext;<a name="line.548"></a>
+<span class="sourceLineNo">549</span>   }<a name="line.549"></a>
+<span class="sourceLineNo">550</span><a name="line.550"></a>
+<span class="sourceLineNo">551</span>   /**<a name="line.551"></a>
+<span class="sourceLineNo">552</span>    * Returns a URI resolver that can be used to convert URIs to absolute or root-relative form.<a name="line.552"></a>
+<span class="sourceLineNo">553</span>    *<a name="line.553"></a>
+<span class="sourceLineNo">554</span>    * @param resolution The URI resolution rule.<a name="line.554"></a>
+<span class="sourceLineNo">555</span>    * @param relativity The relative URI relativity rule.<a name="line.555"></a>
+<span class="sourceLineNo">556</span>    * @return The URI resolver for this request.<a name="line.556"></a>
+<span class="sourceLineNo">557</span>    */<a name="line.557"></a>
+<span class="sourceLineNo">558</span>   public UriResolver getUriResolver(UriResolution resolution, UriRelativity relativity) {<a name="line.558"></a>
+<span class="sourceLineNo">559</span>      return new UriResolver(resolution, relativity, getUriContext());<a name="line.559"></a>
+<span class="sourceLineNo">560</span>   }<a name="line.560"></a>
+<span class="sourceLineNo">561</span><a name="line.561"></a>
+<span class="sourceLineNo">562</span>   /**<a name="line.562"></a>
+<span class="sourceLineNo">563</span>    * Shortcut for calling {@link #getUriResolver()} using {@link UriResolution#ROOT_RELATIVE} and<a name="line.563"></a>
+<span class="sourceLineNo">564</span>    * {@link UriRelativity#RESOURCE}<a name="line.564"></a>
+<span class="sourceLineNo">565</span>    *<a name="line.565"></a>
+<span class="sourceLineNo">566</span>    * @return The URI resolver for this request.<a name="line.566"></a>
+<span class="sourceLineNo">567</span>    */<a name="line.567"></a>
+<span class="sourceLineNo">568</span>   public UriResolver getUriResolver() {<a name="line.568"></a>
+<span class="sourceLineNo">569</span>      return new UriResolver(UriResolution.ROOT_RELATIVE, UriRelativity.RESOURCE, getUriContext());<a name="line.569"></a>
+<span class="sourceLineNo">570</span>   }<a name="line.570"></a>
+<span class="sourceLineNo">571</span><a name="line.571"></a>
+<span class="sourceLineNo">572</span>   /**<a name="line.572"></a>
+<span class="sourceLineNo">573</span>    * Returns the URI for this request.<a name="line.573"></a>
+<span class="sourceLineNo">574</span>    *<a name="line.574"></a>
+<span class="sourceLineNo">575</span>    * &lt;p&gt;<a name="line.575"></a>
+<span class="sourceLineNo">576</span>    * Similar to {@link #getRequestURI()} but returns the value as a {@link URI}.<a name="line.576"></a>
+<span class="sourceLineNo">577</span>    * It also gives you the capability to override the query parameters (e.g. add new query parameters to the existing<a name="line.577"></a>
+<span class="sourceLineNo">578</span>    * URI).<a name="line.578"></a>
+<span class="sourceLineNo">579</span>    *<a name="line.579"></a>
+<span class="sourceLineNo">580</span>    * @param includeQuery If &lt;jk&gt;true&lt;/jk&gt; include the query parameters on the request.<a name="line.580"></a>
+<span class="sourceLineNo">581</span>    * @param addQueryParams Augment the request URI with the specified query parameters.<a name="line.581"></a>
+<span class="sourceLineNo">582</span>    * @return A new URI.<a name="line.582"></a>
+<span class="sourceLineNo">583</span>    */<a name="line.583"></a>
+<span class="sourceLineNo">584</span>   public URI getUri(boolean includeQuery, Map&lt;String,?&gt; addQueryParams) {<a name="line.584"></a>
+<span class="sourceLineNo">585</span>      String uri = getRequestURI();<a name="line.585"></a>
+<span class="sourceLineNo">586</span>      if (includeQuery || addQueryParams != null) {<a name="line.586"></a>
+<span class="sourceLineNo">587</span>         StringBuilder sb = new StringBuilder(uri);<a name="line.587"></a>
+<span class="sourceLineNo">588</span>         RequestQuery rq = this.queryParams.copy();<a name="line.588"></a>
+<span class="sourceLineNo">589</span>         if (addQueryParams != null)<a name="line.589"></a>
+<span class="sourceLineNo">590</span>            for (Map.Entry&lt;String,?&gt; e : addQueryParams.entrySet())<a name="line.590"></a>
+<span class="sourceLineNo">591</span>               rq.put(e.getKey(), e.getValue());<a name="line.591"></a>
+<span class="sourceLineNo">592</span>         if (! rq.isEmpty())<a name="line.592"></a>
+<span class="sourceLineNo">593</span>            sb.append('?').append(rq.toQueryString());<a name="line.593"></a>
+<span class="sourceLineNo">594</span>         uri = sb.toString();<a name="line.594"></a>
+<span class="sourceLineNo">595</span>      }<a name="line.595"></a>
+<span class="sourceLineNo">596</span>      try {<a name="line.596"></a>
+<span class="sourceLineNo">597</span>         return new URI(uri);<a name="line.597"></a>
+<span class="sourceLineNo">598</span>      } catch (URISyntaxException e) {<a name="line.598"></a>
+<span class="sourceLineNo">599</span>         // Shouldn't happen.<a name="line.599"></a>
+<span class="sourceLineNo">600</span>         throw new RuntimeException(e);<a name="line.600"></a>
+<span class="sourceLineNo">601</span>      }<a name="line.601"></a>
+<span class="sourceLineNo">602</span>   }<a name="line.602"></a>
+<span class="sourceLineNo">603</span><a name="line.603"></a>
+<span class="sourceLineNo">604</span>   //--------------------------------------------------------------------------------<a name="line.604"></a>
+<span class="sourceLineNo">605</span>   // Labels<a name="line.605"></a>
+<span class="sourceLineNo">606</span>   //--------------------------------------------------------------------------------<a name="line.606"></a>
+<span class="sourceLineNo">607</span><a name="line.607"></a>
+<span class="sourceLineNo">608</span>   /**<a name="line.608"></a>
+<span class="sourceLineNo">609</span>    * Returns the info provider on the servlet.<a name="line.609"></a>
+<span class="sourceLineNo">610</span>    * <a name="line.610"></a>
+<span class="sourceLineNo">611</span>    * @return The info provider on the servlet.<a name="line.611"></a>
+<span class="sourceLineNo">612</span>    */<a name="line.612"></a>
+<span class="sourceLineNo">613</span>   public RestInfoProvider getInfoProvider() {<a name="line.613"></a>
+<span class="sourceLineNo">614</span>      return context.getInfoProvider();<a name="line.614"></a>
+<span class="sourceLineNo">615</span>   }<a name="line.615"></a>
+<span class="sourceLineNo">616</span>   <a name="line.616"></a>
+<span class="sourceLineNo">617</span>   /**<a name="line.617"></a>
+<span class="sourceLineNo">618</span>    * Returns the localized site name.<a name="line.618"></a>
+<span class="sourceLineNo">619</span>    *<a name="line.619"></a>
+<span class="sourceLineNo">620</span>    * &lt;p&gt;<a name="line.620"></a>
+<span class="sourceLineNo">621</span>    * The site name is intended to be a title that can be applied to the entire site.<a name="line.621"></a>
+<span class="sourceLineNo">622</span>    *<a name="line.622"></a>
+<span class="sourceLineNo">623</span>    * &lt;p&gt;<a name="line.623"></a>
+<span class="sourceLineNo">624</span>    * One possible use is if you want to add the same title to the top of all pages by defining a header on a<a name="line.624"></a>
+<span class="sourceLineNo">625</span>    * common parent class like so:<a name="line.625"></a>
+<span class="sourceLineNo">626</span>    * &lt;p class='bcode'&gt;<a name="line.626"></a>
+<span class="sourceLineNo">627</span>    *    htmldoc=&lt;ja&gt;@HtmlDoc&lt;/ja&gt;(<a name="line.627"></a>
+<span class="sourceLineNo">628</span>    *       header={<a name="line.628"></a>
+<span class="sourceLineNo">629</span>    *          &lt;js&gt;"&amp;lt;h1&amp;gt;$R{siteName}&amp;lt;/h1&amp;gt;"&lt;/js&gt;,<a name="line.629"></a>
+<span class="sourceLineNo">630</span>    *          &lt;js&gt;"&amp;lt;h2&amp;gt;$R{servletTitle}&amp;lt;/h2&amp;gt;"&lt;/js&gt;<a name="line.630"></a>
+<span class="sourceLineNo">631</span>    *       }<a name="line.631"></a>
+<span class="sourceLineNo">632</span>    *    )<a name="line.632"></a>
+<span class="sourceLineNo">633</span>    * &lt;/p&gt;<a name="line.633"></a>
+<span class="sourceLineNo">634</span>    *<a name="line.634"></a>
+<span class="sourceLineNo">635</span>    * &lt;p&gt;<a name="line.635"></a>
+<span class="sourceLineNo">636</span>    * Equivalent to calling {@link RestInfoProvider#getSiteName(RestRequest)} with this object.<a name="line.636"></a>
+<span class="sourceLineNo">637</span>    *<a name="line.637"></a>
+<span class="sourceLineNo">638</span>    * @return The localized servlet label.<a name="line.638"></a>
+<span class="sourceLineNo">639</span>    */<a name="line.639"></a>
+<span class="sourceLineNo">640</span>   public String getSiteName() {<a name="line.640"></a>
+<span class="sourceLineNo">641</span>      return context.getInfoProvider().getSiteName(this);<a name="line.641"></a>
+<span class="sourceLineNo">642</span>   }<a name="line.642"></a>
+<span class="sourceLineNo">643</span><a name="line.643"></a>
+<span class="sourceLineNo">644</span>   /**<a name="line.644"></a>
+<span class="sourceLineNo">645</span>    * Returns the localized servlet title.<a name="line.645"></a>
+<span class="sourceLineNo">646</span>    *<a name="line.646"></a>
+<span class="sourceLineNo">647</span>    * &lt;p&gt;<a name="line.647"></a>
+<span class="sourceLineNo">648</span>    * Equivalent to calling {@link RestInfoProvider#getTitle(RestRequest)} with this object.<a name="line.648"></a>
+<span class="sourceLineNo">649</span>    *<a name="line.649"></a>
+<span class="sourceLineNo">650</span>    * @return The localized servlet label.<a name="line.650"></a>
+<span class="sourceLineNo">651</span>    */<a name="line.651"></a>
+<span class="sourceLineNo">652</span>   public String getServletTitle() {<a name="line.652"></a>
+<span class="sourceLineNo">653</span>      return context.getInfoProvider().getTitle(this);<a name="line.653"></a>
+<span class="sourceLineNo">654</span>   }<a name="line.654"></a>
+<span class="sourceLineNo">655</span><a name="line.655"></a>
+<span class="sourceLineNo">656</span>   /**<a name="line.656"></a>
+<span class="sourceLineNo">657</span>    * Returns the localized servlet description.<a name="line.657"></a>
+<span class="sourceLineNo">658</span>    *<a name="line.658"></a>
+<span class="sourceLineNo">659</span>    * &lt;p&gt;<a name="line.659"></a>
+<span class="sourceLineNo">660</span>    * Equivalent to calling {@link RestInfoProvider#getDescription(RestRequest)} with this object.<a name="line.660"></a>
+<span class="sourceLineNo">661</span>    *<a name="line.661"></a>
+<span class="sourceLineNo">662</span>    * @return The localized servlet description.<a name="line.662"></a>
+<span class="sourceLineNo">663</span>    */<a name="line.663"></a>
+<span class="sourceLineNo">664</span>   public String getServletDescription() {<a name="line.664"></a>
+<span class="sourceLineNo">665</span>      return context.getInfoProvider().getDescription(this);<a name="line.665"></a>
+<span class="sourceLineNo">666</span>   }<a name="line.666"></a>
+<span class="sourceLineNo">667</span><a name="line.667"></a>
+<span class="sourceLineNo">668</span>   /**<a name="line.668"></a>
+<span class="sourceLineNo">669</span>    * Returns the localized method summary.<a name="line.669"></a>
+<span class="sourceLineNo">670</span>    *<a name="line.670"></a>
+<span class="sourceLineNo">671</span>    * &lt;p&gt;<a name="line.671"></a>
+<span class="sourceLineNo">672</span>    * Equivalent to calling {@link RestInfoProvider#getMethodSummary(String, RestRequest)} with this object.<a name="line.672"></a>
+<span class="sourceLineNo">673</span>    *<a name="line.673"></a>
+<span class="sourceLineNo">674</span>    * @return The localized method description.<a name="line.674"></a>
+<span class="sourceLineNo">675</span>    */<a name="line.675"></a>
+<span class="sourceLineNo">676</span>   public String getMethodSummary() {<a name="line.676"></a>
+<span class="sourceLineNo">677</span>      return context.getInfoProvider().getMethodSummary(javaMethod.getName(), this);<a name="line.677"></a>
+<span class="sourceLineNo">678</span>   }<a name="line.678"></a>
+<span class="sourceLineNo">679</span><a name="line.679"></a>
+<span class="sourceLineNo">680</span>   /**<a name="line.680"></a>
+<span class="sourceLineNo">681</span>    * Returns the localized method description.<a name="line.681"></a>
+<span class="sourceLineNo">682</span>    *<a name="line.682"></a>
+<span class="sourceLineNo">683</span>    * &lt;p&gt;<a name="line.683"></a>
+<span class="sourceLineNo">684</span>    * Equivalent to calling {@link RestInfoProvider#getMethodDescription(String, RestRequest)} with this object.<a name="line.684"></a>
+<span class="sourceLineNo">685</span>    *<a name="line.685"></a>
+<span class="sourceLineNo">686</span>    * @return The localized method description.<a name="line.686"></a>
+<span class="sourceLineNo">687</span>    */<a name="line.687"></a>
+<span class="sourceLineNo">688</span>   public String getMethodDescription() {<a name="line.688"></a>
+<span class="sourceLineNo">689</span>      return context.getInfoProvider().getMethodDescription(javaMethod.getName(), this);<a name="line.689"></a>
+<span class="sourceLineNo">690</span>   }<a name="line.690"></a>
+<span class="sourceLineNo">691</span><a name="line.691"></a>
+<span class="sourceLineNo">692</span>   //--------------------------------------------------------------------------------<a name="line.692"></a>
+<span class="sourceLineNo">693</span>   // Other methods<a name="line.693"></a>
+<span class="sourceLineNo">694</span>   //--------------------------------------------------------------------------------<a name="line.694"></a>
+<span class="sourceLineNo">695</span><a name="line.695"></a>
+<span class="sourceLineNo">696</span>   /**<a name="line.696"></a>
+<span class="sourceLineNo">697</span>    * Returns the serializers associated with this request.<a name="line.697"></a>
+<span class="sourceLineNo">698</span>    *<a name="line.698"></a>
+<span class="sourceLineNo">699</span>    * @return The serializers associated with this request.<a name="line.699"></a>
+<span class="sourceLineNo">700</span>    */<a name="line.700"></a>
+<span class="sourceLineNo">701</span>   public SerializerGroup getSerializerGroup() {<a name="line.701"></a>
+<span class="sourceLineNo">702</span>      return serializerGroup;<a name="line.702"></a>
+<span class="sourceLineNo">703</span>   }<a name="line.703"></a>
+<span class="sourceLineNo">704</span><a name="line.704"></a>
+<span class="sourceLineNo">705</span>   /**<a name="line.705"></a>
+<span class="sourceLineNo">706</span>    * Returns the parsers associated with this request.<a name="line.706"></a>
+<span class="sourceLineNo">707</span>    *<a name="line.707"></a>
+<span class="sourceLineNo">708</span>    * @return The parsers associated with this request.<a name="line.708"></a>
+<span class="sourceLineNo">709</span>    */<a name="line.709"></a>
+<span class="sourceLineNo">710</span>   public ParserGroup getParserGroup() {<a name="line.710"></a>
+<span class="sourceLineNo">711</span>      return parserGroup;<a name="line.711"></a>
+<span class="sourceLineNo">712</span>   }<a name="line.712"></a>
 <span class="sourceLineNo">713</span><a name="line.713"></a>
-<span class="sourceLineNo">714</span>   /**<a name="line.714"></a>
-<span class="sourceLineNo">715</span>    * Returns the method of this request.<a name="line.715"></a>
-<span class="sourceLineNo">716</span>    *<a name="line.716"></a>
-<span class="sourceLineNo">717</span>    * &lt;p&gt;<a name="line.717"></a>
-<span class="sourceLineNo">718</span>    * If &lt;code&gt;allowHeaderParams&lt;/code&gt; init parameter is &lt;jk&gt;true&lt;/jk&gt;, then first looks for<a name="line.718"></a>
-<span class="sourceLineNo">719</span>    * &lt;code&gt;&amp;amp;method=xxx&lt;/code&gt; in the URL query string.<a name="line.719"></a>
-<span class="sourceLineNo">720</span>    */<a name="line.720"></a>
-<span class="sourceLineNo">721</span>   @Override /* ServletRequest */<a name="line.721"></a>
-<span class="sourceLineNo">722</span>   public String getMethod() {<a name="line.722"></a>
-<span class="sourceLineNo">723</span>      return method;<a name="line.723"></a>
-<span class="sourceLineNo">724</span>   }<a name="line.724"></a>
-<span class="sourceLineNo">725</span><a name="line.725"></a>
-<span class="sourceLineNo">726</span>   /**<a name="line.726"></a>
-<span class="sourceLineNo">727</span>    * Returns the HTTP 1.1 method name of the request as an enum.<a name="line.727"></a>
-<span class="sourceLineNo">728</span>    *<a name="line.728"></a>
-<span class="sourceLineNo">729</span>    * &lt;p&gt;<a name="line.729"></a>
-<span class="sourceLineNo">730</span>    * Note that non-RFC2616 method names resolve as {@link HttpMethod#OTHER}.<a name="line.730"></a>
-<span class="sourceLineNo">731</span>    *<a name="line.731"></a>
-<span class="sourceLineNo">732</span>    * @return The HTTP method.<a name="line.732"></a>
-<span class="sourceLineNo">733</span>    */<a name="line.733"></a>
-<span class="sourceLineNo">734</span>   public HttpMethod getHttpMethod() {<a name="line.734"></a>
-<span class="sourceLineNo">735</span>      return HttpMethod.forString(method);<a name="line.735"></a>
-<

<TRUNCATED>


Mime
View raw message