aspose file tools
The moose likes Servlets and the fly likes POST method parameters Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Servlets
Reply 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
Bartender

Joined: Aug 16, 2005
Posts: 12952
    
    3

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: 56529
    
  14

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.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: POST method parameters
 
Similar Threads
want to send a value to a sevlet
call a html/jsp page from an applet and pass parameters in post method
get parameter in Servlet in different way
two questions
How to hide the parameters in the URL??