You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by nanomonk <br...@inbox.ru> on 2008/02/20 12:38:07 UTC

[C2.1.11] get Content from request

xsp. I need to take content of request.
no method getContent() .
but there is getInputStream(), but I can't understand how to use that... how
I can to take content like a String?
btw, I found this method:
private byte[] getContent(HttpServletRequest req)
    {
        if (req.getParameter("content") != null)
            return Base64.decode(req.getParameter("content").getBytes());
        return "".getBytes();
    }
but cocoon Request return _null_ for req.getParameter("content") even if
request.getContentLength() > 0
so, how can I take request Content?
-- 
View this message in context: http://www.nabble.com/-C2.1.11--get-Content-from-request-tp15587155p15587155.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [C2.1.11] get Content from request

Posted by so...@apache.org.
You are mixing many concepts.
Base64 is typically used for translating binary data into text and
back.  That is not likely to be relevant to your goals.  There are
better methods for handling binary files.
Cocoon empties the InputStream so that should be useless to you.

The request is stored in Cocoon's objectModel Map.  That may be
useful, but the request variable is available to XSPs without work:
<xsp:logic>Enumeration parameterNames = request.getParameterNames();</xsp:logic>

You should explain what you are attempting.  XSP may be part of the
solution, but easier methods may exist.  The RequestGenerator includes
the content of the request. Your function might be achievable with
standard components and some XSL.

solprovider


On Wed, Feb 20, 2008 at 6:38 AM, nanomonk <br...@inbox.ru> wrote:
>  xsp. I need to take content of request.
>  no method getContent() .
>  but there is getInputStream(), but I can't understand how to use that... how
>  I can to take content like a String?
>  btw, I found this method:
>  private byte[] getContent(HttpServletRequest req)
>     {
>         if (req.getParameter("content") != null)
>             return Base64.decode(req.getParameter("content").getBytes());
>         return "".getBytes();
>     }
>  but cocoon Request return _null_ for req.getParameter("content") even if
>  request.getContentLength() > 0
>  so, how can I take request Content?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org