cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From olivier demah <ode...@messagio.com>
Subject request.getParameters / form enctype (was ESQL INSERT)
Date Thu, 01 Apr 2004 15:56:37 GMT
olivier demah wrote:

> from a form i get my data i want logically insert in my database so i 
> did the following , but nothing comes in my blog_news table
>
> <blog_addingnews>
>    <xsp:logic>
>    String id_blog_user = request.getParameter("id_blog_user");
>    String id_blog_news = request.getParameter("id_blog_news");
>    String news_title = request.getParameter("news_title");
>    String news_text = request.getParameter("news_text");
>    String news_image = request.getParameter("news_image");
>    </xsp:logic>
>    <id_blog_user><xsp-request:get-parameter 
> name="id_blog_user"/></id_blog_user>
>    <esql:connection>
>        <esql:pool>mblog_pg</esql:pool>
>        <esql:execute-query>
>            <esql:query>
>            INSERT INTO blog_news 
> (id_blog_news,id_blog_user,news_title,news_text,news_image,news_date_creation,news_date_modify)

>
>            VALUES ('',<xsp:expr>id_blog_user</xsp:expr>,
>            <xsp:expr>news_title</xsp:expr>,
>            <xsp:expr>news_text</xsp:expr>,
>            <xsp:expr>news_image</xsp:expr>,
>            today,NULL);
>            </esql:query>
>            <esql:error-results>Database Error</esql:error-results>
>            <esql:update-results>
>                <esql:get-update-count/> Added
>            </esql:update-results>
>            <esql:no-results>
>               <p>nothing done</p>
>            </esql:no-results>
>        </esql:execute-query>
>    </esql:connection>
> </blog_addingnews>
> </xsp:page>
>
> Regards.


I found the solution after 1 week of debugging ....

when i submited my form ; all the request.getParameter were empty !!!

Why ?
Because in my previous form i wrote :

<form enctype="multipart/form-data" action="blog_addingnews.html" 
method="post">

instead of
<form action="blog_addingnews.html" method="post">-->

(i used enctype because i needed to upload file)


Thank to enctype to waste the time i dont have :-(

Hope this experience could help.

If only i had found a tips about that earlier ...

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


Mime
View raw message