File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes POST method parameters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "POST method parameters" Watch "POST method parameters" New topic
Author

POST method parameters

Shweta Machhe
Greenhorn

Joined: Nov 22, 2011
Posts: 8
How can i get the parameters that are submitted In request by POSt method?Is there any way in java to get these values?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13875
    
  10

If you are programming a servlet, then you can call the getParameter("paramname") method on the ServletRequest object that is passed to the doPost() method of your servlet. In a JSP, there will be an implicit 'request' variable on which you can call getParameter("paramname") on that directly.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Shweta Machhe
Greenhorn

Joined: Nov 22, 2011
Posts: 8
I am getting the POST method parameters by request.getparameter(""); method.

But my problem is that, i want to block the password fields in request. I had encrypted these password fields on my submit button click using ajax & again set these encrypted values to form. So that in my form submit action i am getting encrypted values.

But this whole logic fails when i use tools like Selenium automates browsers. This is an Mozilla tool where we can record our browser activities by recording events.
When i start recording browser events in this tool, it captures the form values that are changed, means suppose i have 10 fields on my UI, n i change only 2 of them,one by key type & one by mouse paste. then it directly records these events. So even if i had encrypted these fields after form submit,its of no use.

Please suggest me any solution on it.
Arun Kumar
Ranch Hand

Joined: Oct 10, 2007
Posts: 30
could you post the error/exception for using selenium?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

Why on earth are you encrypting the field? And in JavaScript? That means that your algorithm is published for all to see and crack.

Just use SSL to protect sensitive data in transit.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: POST method parameters
 
Similar Threads
want to send a value to a sevlet
How to hide the parameters in the URL??
two questions
get parameter in Servlet in different way
call a html/jsp page from an applet and pass parameters in post method