• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

How to hide passwords?

 
Ranch Hand
Posts: 63
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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]
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use POST method while submitting the FORM.
 
Ranch Hand
Posts: 56
Eclipse IDE Postgres Database Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 67682
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67682
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[hijack removed]
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67682
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What's with the blank action?
 
cho con
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.)
 
Why am I so drawn to cherry pie? I can't seem to stop. Save me tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic