FYI: slightly odd behavior of request:get-data()

View: New views
3 Messages — Rating Filter:   Alert me  

FYI: slightly odd behavior of request:get-data()

by alex-448 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It appears that request:get-data() eats the request body. I was doing
something like

let $data := request:get-data()
return if ( $data ) then
        <p> request:get-parameter("parm1","") <p>
        (etc.)

and nothing was being returned from get-parameter(). Omit the call to
get-data() and everything's fine.  Nothing serious, just thought i'd mention
it in case it bites someone else.

--alex.



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: FYI: slightly odd behavior of request:get-data()

by Dannes Wessels-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

On Jul 18, 2008, at 19:32 , alex wrote:
and nothing was being returned from get-parameter(). Omit the call to
get-data() and everything's fine.  Nothing serious, just thought i'd mention
it in case it bites someone else.

are you sure about this? If you rewrite your query just a bit:

( request:get-data() ,  request:get-parameter("parm1","") )

then all seems to work just fine....... in your opinion what do you think "if ( $data )" should do?

D.

--
eXist-db Open Source Native XML Database








-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

smime.p7s (2K) Download Attachment

Re: FYI: slightly odd behavior of request:get-data()

by alex-448 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> are you sure about this? If you rewrite your query just a bit:
>
> ( request:get-data() ,  request:get-parameter("parm1","") )
>
> then all seems to work just fine....... in your opinion what do you
> think "if ( $data )" should do?

Am POSTing back to the same .xql file in the db as generates the original
form. So something like

return if (request:get-data()) then
        request:get-parameter("parm1","")
        (: and so on, handling the form submit :)
else
        <html> the original form </html>


Again, no big deal, i can just test for parm1 to see if i was called as form
display or submit, just thought it was odd that let y := get-parameter()
didn't work once let x := get-data() was called.  --alex.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open
LightInTheBox - Buy quality products at wholesale price