0

receiving POST data in a ZUL page

asked 2007-03-16 17:24:20 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4211295

By: ldrolez

Hi !

I'm trying to interface a ZUL script with an old script which will POST data to the ZUL scripts.
I can retreive GET data with Executions.getCurrent().getParameter("...") but not POST data.
Is there a trick with Executions.getCurrent().getNativeResponse() ? (BTW I use Jetty 6.1).

Cheers,

Ludo.


delete flag offensive retag edit

6 Replies

Sort by ยป oldest newest

answered 2007-03-20 07:07:44 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4215984

By: robbiecheng

Did you try to retrieve data through implicit object param?
It works for me to pass data of string via doPost().

/robbie

link publish delete flag offensive edit

answered 2007-03-20 10:07:54 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4216223

By: ldrolez

In fact, I can get all the parameters POST and GET, with Executions.getCurrent().getParameter().
But usually, you can also use the request InputStream, to get POST data:

Executions.getCurrent().getNativeRequest().getInputStream();

But the stream is empty.
The problem is that I have all GET and POST parameters with getParameter() but, I cannot differentiate GET and POST parameters if I cannot get the InputStream...

Any ideas ?

Ludovic.

link publish delete flag offensive edit

answered 2007-03-20 15:16:30 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4216698

By: robbiecheng

If you only want to distinguish doPost() from doGet(),ServletRequest.getMethod()
will return which http method is used.

ex:Executions.getCurrent().getNativeRequest().getMethod()

/robbie

link publish delete flag offensive edit

answered 2007-03-20 22:36:40 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4217527

By: ldrolez

Yes, but when you have a POST with both GET and POST data, you cannot distinguish them...

link publish delete flag offensive edit

answered 2020-11-10 16:24:43 +0800

ziobleed gravatar image ziobleed
1 1

Im really interested in this cause i want read only the parameters in the post (in the form) and ignoring the parameters in the url. This because i dont want a naive user alter /add parameters in url to send different data

link publish delete flag offensive edit

answered 2020-11-12 11:16:18 +0800

cor3000 gravatar image cor3000
5409 2 7
ZK Team

updated 2020-11-12 11:17:48 +0800

the servlet spec doesn't differentiate between GET and POST parameters, as documented: see ServletRequest.getParameterMap()

From an HTTP client (such as a browser) both (GET/POST) can be manipulated easily. Your server should always expect and be able to deal with incorrect/tampered request parameters. (The 'naive' user would be your smallest problem there). So whenever processing request parameters you'll have to validate/sanitize them in your code, or check the user's permission to that resource.

If you still need to access the parameters from the URL string you can read the original query string of the request object: HttpServletRequest.getQueryString()

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2007-03-16 17:24:20 +0800

Seen: 465 times

Last updated: Nov 12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More