You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Konrad Windszus <ko...@gmx.de> on 2016/02/12 16:57:59 UTC
Clarification on Sling Parameter Handlling
Hi,
I would like to clarify few things on https://sling.apache.org/documentation/the-sling-engine/request-parameters.html but quickly wanted to check here first if no one opposes.
1. Since Servlet Spec 3.0 there was support for multipart requests being added (through HttpServletRequest.getParts()), therefore the arguments in the section https://sling.apache.org/documentation/the-sling-engine/request-parameters.html#servlet-api should be clarified.
2. From within Sling Servlets/Scripts you can no longer rely on the original Servlet API handling of parameters, because all servlet spec methods dealing with parameters like getParameter(String), getParameterNames(), getParameterValues(), getParameterMap() are now internally relying on the Sling Parameter Support (instead of relying on the underlying servlet engine for that matter). I would like to add that information to the section https://sling.apache.org/documentation/the-sling-engine/request-parameters.html#sling-api.
3. Also I would like to clarify that relying on HttpServletRequest#getInputStream() within Sling and also on third party libs internally using it (like Apache Commons Fileupload) is in most of the cases not working, since the parameter support of Sling exclusively needs access to that input stream (it either has consumed it already or is probably trying to do that afterwards to extract the parameters).
Is everyone fine, if I add that information to https://sling.apache.org/documentation/the-sling-engine/request-parameters.html
Konrad
Re: Clarification on Sling Parameter Handlling
Posted by Konrad Windszus <ko...@gmx.de>.
I added that information about Servlet Spec 3.0 to https://sling.apache.org/documentation/the-sling-engine/request-parameters.html#servlet-api.
Also I extended the information on not calling Servlet Spec parameter methods from within Sling in https://sling.apache.org/documentation/the-sling-engine/request-parameters.html#effects-of-sling-on-servlet-api-parameter-methods.
> On 12 Feb 2016, at 17:22, Carsten Ziegeler <cz...@apache.org> wrote:
>
> Konrad Windszus wrote
>> Hi,
>> I would like to clarify few things on https://sling.apache.org/documentation/the-sling-engine/request-parameters.html but quickly wanted to check here first if no one opposes.
>>
>> 1. Since Servlet Spec 3.0 there was support for multipart requests being added (through HttpServletRequest.getParts()), therefore the arguments in the section https://sling.apache.org/documentation/the-sling-engine/request-parameters.html#servlet-api should be clarified.
>>
>> 2. From within Sling Servlets/Scripts you can no longer rely on the original Servlet API handling of parameters, because all servlet spec methods dealing with parameters like getParameter(String), getParameterNames(), getParameterValues(), getParameterMap() are now internally relying on the Sling Parameter Support (instead of relying on the underlying servlet engine for that matter). I would like to add that information to the section https://sling.apache.org/documentation/the-sling-engine/request-parameters.html#sling-api.
>>
>> 3. Also I would like to clarify that relying on HttpServletRequest#getInputStream() within Sling and also on third party libs internally using it (like Apache Commons Fileupload) is in most of the cases not working, since the parameter support of Sling exclusively needs access to that input stream (it either has consumed it already or is probably trying to do that afterwards to extract the parameters).
>>
>> Is everyone fine, if I add that information to https://sling.apache.org/documentation/the-sling-engine/request-parameters.html
>>
> Lgtm, thanks Konrad
>
> Carsten
>
>> Konrad
>>
>
>
>
> --
> Carsten Ziegeler
> Adobe Research Switzerland
> cziegeler@apache.org
Re: Clarification on Sling Parameter Handlling
Posted by Carsten Ziegeler <cz...@apache.org>.
Konrad Windszus wrote
> Hi,
> I would like to clarify few things on https://sling.apache.org/documentation/the-sling-engine/request-parameters.html but quickly wanted to check here first if no one opposes.
>
> 1. Since Servlet Spec 3.0 there was support for multipart requests being added (through HttpServletRequest.getParts()), therefore the arguments in the section https://sling.apache.org/documentation/the-sling-engine/request-parameters.html#servlet-api should be clarified.
>
> 2. From within Sling Servlets/Scripts you can no longer rely on the original Servlet API handling of parameters, because all servlet spec methods dealing with parameters like getParameter(String), getParameterNames(), getParameterValues(), getParameterMap() are now internally relying on the Sling Parameter Support (instead of relying on the underlying servlet engine for that matter). I would like to add that information to the section https://sling.apache.org/documentation/the-sling-engine/request-parameters.html#sling-api.
>
> 3. Also I would like to clarify that relying on HttpServletRequest#getInputStream() within Sling and also on third party libs internally using it (like Apache Commons Fileupload) is in most of the cases not working, since the parameter support of Sling exclusively needs access to that input stream (it either has consumed it already or is probably trying to do that afterwards to extract the parameters).
>
> Is everyone fine, if I add that information to https://sling.apache.org/documentation/the-sling-engine/request-parameters.html
>
Lgtm, thanks Konrad
Carsten
> Konrad
>
--
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org