• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to hide passwords?

 
Moguluri Ravi Kiran
Ranch Hand
Posts: 63
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello to every one...

I written a servlet that sends a login form to browser, while submiting the form the password field value is being displayed in the URL, please tell me how to print the '*'s rather than printing the original value...



waiting for reply.

[moderator edited subject line: remove attempt to make title bold, changed all uppercase to mixed case]
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use POST method while submitting the FORM.
 
Charles 'King
Ranch Hand
Posts: 56
Eclipse IDE Postgres Database Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moguluri Ravi Kiran wrote:Hello to every one...

please tell me how to print the '*'s rather than printing the original value...


input type=password -> http://www.w3.org/MarkUp/html-spec/html-spec_8.html

By the way, this is a HTML question, not servlet
 
cho con
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think Sagar's problem is not about the input. He mentioned about sending request and it shows the password in the URL then it's not safe on the internet. I also have the same problem as yours, I guess that you are using GET method or hidden input with the action, right? I think you can try to use POST method, or look for some way to encode it before sending request (but I haven't tried it yet since I have only little time for my project). Hope that someone can give better solution.
 
cho con
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sorry for wrong name, Charles not Sagar
 
cho con
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I forgot to say that when I use Form with POST method and hidden input control which contains the action, the password still be showed in the URL, you have any suggest for my case?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65126
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please take the time to choose the correct forum for your posts. This forum is for questions on Servlets. For more information, please read this.

This post has been moved to a more appropriate forum.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65126
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using a POST will prevent the password from being tacked onto the URL, but this does not add any level of security.

All requests that contain sensitive information should be performed under SSL.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cho con wrote:I forgot to say that when I use Form with POST method and hidden input control which contains the action, the password still be showed in the URL, you have any suggest for my case?

I'd suggest your browser is fundamentally broken--POST requests will not show request parameters in the URL.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cho con wrote:I forgot to say that when I use Form with POST method and hidden input control which contains the action, the password still be showed in the URL, you have any suggest for my case?

Problem might be in your code. Post the same code here. You might doing something wrong with the FORM.
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[hijack removed]
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Samanthi: Don't hijack threads. You ever consider searching for these kinds of questions?!
 
cho con
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sagar Rohankar wrote:
cho con wrote:I forgot to say that when I use Form with POST method and hidden input control which contains the action, the password still be showed in the URL, you have any suggest for my case?

Problem might be in your code. Post the same code here. You might doing something wrong with the FORM.


This is my code part, when I use the method="post" sometimes it makes my code doesnot work, it still stay at the login page, just like after clicking submit button, it still get the same action leading to the login page, it also makes me confuse

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65126
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's with the blank action?
 
cho con
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually the action I did in the form means nothing. The response from server will depend on the "value" of the hidden input control name "action", then my servlet will manage the web depending on this value.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cho con wrote:when I use the method="post" sometimes it makes my code doesnot work, it still stay at the login page, just like after clicking submit button, it still get the same action leading to the login page, it also makes me confuse

The empty action doesn't go anywhere. Its will stay on the same page.

cho con wrote:Actually the action I did in the form means nothing. The response from server will depend on the "value" of the hidden input control name "action", then my servlet will manage the web depending on this value.

Nope. This is NOT how request action is processed at server side. Server looks for the ACTION attribute of the FORM tag in order to decide which servlet/action to be called.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(Well... a postback from will go to whatever page/servlet/JSP/etc. the client is already on, which may or may not do something with the hidden field to determine execution path. So if this page is being displayed via a servlet + forward, the post would go to that same servlet.)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic